From e25c68a1b3d83e21fe21596ca683c46e481a2d02 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Wed, 19 Sep 2018 16:14:03 +1000 Subject: [PATCH 01/46] Bump fog-core version to 2.1.2 --- fog-google.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fog-google.gemspec b/fog-google.gemspec index 42d4fa2432..954ab238b1 100644 --- a/fog-google.gemspec +++ b/fog-google.gemspec @@ -21,13 +21,13 @@ Gem::Specification.new do |spec| spec.required_ruby_version = "~> 2.0" # Locked until https://github.com/fog/fog-google/issues/417 is resolved - spec.add_dependency "fog-core", "<= 2.1.0" + spec.add_dependency "fog-core", "~> 2.1.2" spec.add_dependency "fog-json", "~> 1.2.0" spec.add_dependency "fog-xml", "~> 0.1.0" # Hard Requirement as of 1.0 spec.add_dependency "google-api-client", "~> 0.23.0" - + # Debugger spec.add_development_dependency "pry" spec.add_development_dependency "pry-byebug" From d110066929f27023691c51e17bca2e03de8a691f Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 16:41:43 +1000 Subject: [PATCH 02/46] Rename Fog::Compute::Google to Fog::Google::Compute --- CHANGELOG.md | 48 +++++++++---------- CONTRIBUTING.md | 22 ++++----- README.md | 16 +++---- lib/fog/bin/google.rb | 2 +- lib/fog/google.rb | 6 +-- .../google.rb => google/compute/compute.rb} | 12 ++--- .../google => google/compute}/mock.rb | 4 +- .../compute}/models/address.rb | 12 ++--- .../compute}/models/addresses.rb | 6 +-- .../compute}/models/backend_service.rb | 8 ++-- .../compute}/models/backend_services.rb | 6 +-- .../google => google/compute}/models/disk.rb | 10 ++-- .../compute}/models/disk_type.rb | 4 +- .../compute}/models/disk_types.rb | 6 +-- .../google => google/compute}/models/disks.rb | 6 +-- .../compute}/models/firewall.rb | 12 ++--- .../compute}/models/firewalls.rb | 6 +-- .../compute}/models/forwarding_rule.rb | 8 ++-- .../compute}/models/forwarding_rules.rb | 6 +-- .../compute}/models/global_address.rb | 8 ++-- .../compute}/models/global_addresses.rb | 6 +-- .../compute}/models/global_forwarding_rule.rb | 8 ++-- .../models/global_forwarding_rules.rb | 6 +-- .../compute}/models/http_health_check.rb | 10 ++-- .../compute}/models/http_health_checks.rb | 6 +-- .../google => google/compute}/models/image.rb | 8 ++-- .../compute}/models/images.rb | 6 +-- .../compute}/models/instance_group.rb | 4 +- .../compute}/models/instance_group_manager.rb | 6 +-- .../models/instance_group_managers.rb | 6 +-- .../compute}/models/instance_groups.rb | 10 ++-- .../compute}/models/instance_template.rb | 8 ++-- .../compute}/models/instance_templates.rb | 6 +-- .../compute}/models/machine_type.rb | 4 +- .../compute}/models/machine_types.rb | 6 +-- .../compute}/models/network.rb | 8 ++-- .../compute}/models/networks.rb | 6 +-- .../compute}/models/operation.rb | 4 +- .../compute}/models/operations.rb | 6 +-- .../compute}/models/project.rb | 6 +-- .../compute}/models/projects.rb | 6 +-- .../compute}/models/region.rb | 4 +- .../compute}/models/regions.rb | 6 +-- .../google => google/compute}/models/route.rb | 8 ++-- .../compute}/models/routes.rb | 6 +-- .../compute}/models/server.rb | 34 ++++++------- .../compute}/models/servers.rb | 6 +-- .../compute}/models/snapshot.rb | 6 +-- .../compute}/models/snapshots.rb | 6 +-- .../compute}/models/ssl_certificate.rb | 8 ++-- .../compute}/models/ssl_certificates.rb | 6 +-- .../compute}/models/subnetwork.rb | 12 ++--- .../compute}/models/subnetworks.rb | 6 +-- .../compute}/models/target_http_proxies.rb | 6 +-- .../compute}/models/target_http_proxy.rb | 10 ++-- .../compute}/models/target_https_proxies.rb | 6 +-- .../compute}/models/target_https_proxy.rb | 14 +++--- .../compute}/models/target_instance.rb | 8 ++-- .../compute}/models/target_instances.rb | 6 +-- .../compute}/models/target_pool.rb | 16 +++---- .../compute}/models/target_pools.rb | 6 +-- .../compute}/models/url_map.rb | 14 +++--- .../compute}/models/url_maps.rb | 6 +-- .../google => google/compute}/models/zone.rb | 4 +- .../google => google/compute}/models/zones.rb | 6 +-- .../google => google/compute}/real.rb | 4 +- .../compute}/requests/abandon_instances.rb | 4 +- .../requests/add_backend_service_backends.rb | 4 +- .../requests/add_instance_group_instances.rb | 4 +- .../requests/add_server_access_config.rb | 4 +- .../requests/add_target_pool_health_checks.rb | 4 +- .../requests/add_target_pool_instances.rb | 4 +- .../compute}/requests/attach_disk.rb | 4 +- .../compute}/requests/create_disk_snapshot.rb | 4 +- .../compute}/requests/delete_address.rb | 4 +- .../requests/delete_backend_service.rb | 4 +- .../compute}/requests/delete_disk.rb | 4 +- .../compute}/requests/delete_firewall.rb | 4 +- .../requests/delete_forwarding_rule.rb | 4 +- .../requests/delete_global_address.rb | 4 +- .../requests/delete_global_forwarding_rule.rb | 4 +- .../requests/delete_global_operation.rb | 4 +- .../requests/delete_http_health_check.rb | 4 +- .../compute}/requests/delete_image.rb | 4 +- .../requests/delete_instance_group.rb | 4 +- .../requests/delete_instance_group_manager.rb | 4 +- .../requests/delete_instance_template.rb | 4 +- .../compute}/requests/delete_network.rb | 4 +- .../requests/delete_region_operation.rb | 4 +- .../compute}/requests/delete_route.rb | 4 +- .../compute}/requests/delete_server.rb | 4 +- .../requests/delete_server_access_config.rb | 4 +- .../compute}/requests/delete_snapshot.rb | 4 +- .../requests/delete_ssl_certificate.rb | 4 +- .../compute}/requests/delete_subnetwork.rb | 4 +- .../requests/delete_target_http_proxy.rb | 4 +- .../requests/delete_target_https_proxy.rb | 4 +- .../requests/delete_target_instance.rb | 4 +- .../compute}/requests/delete_target_pool.rb | 4 +- .../compute}/requests/delete_url_map.rb | 4 +- .../requests/delete_zone_operation.rb | 4 +- .../compute}/requests/deprecate_image.rb | 4 +- .../compute}/requests/detach_disk.rb | 4 +- .../expand_subnetwork_ip_cidr_range.rb | 4 +- .../compute}/requests/get_address.rb | 4 +- .../compute}/requests/get_backend_service.rb | 4 +- .../requests/get_backend_service_health.rb | 4 +- .../compute}/requests/get_disk.rb | 4 +- .../compute}/requests/get_disk_type.rb | 4 +- .../compute}/requests/get_firewall.rb | 4 +- .../compute}/requests/get_forwarding_rule.rb | 4 +- .../compute}/requests/get_global_address.rb | 4 +- .../requests/get_global_forwarding_rule.rb | 4 +- .../compute}/requests/get_global_operation.rb | 4 +- .../requests/get_http_health_check.rb | 4 +- .../compute}/requests/get_image.rb | 4 +- .../requests/get_image_from_family.rb | 4 +- .../compute}/requests/get_instance_group.rb | 4 +- .../requests/get_instance_group_manager.rb | 4 +- .../requests/get_instance_template.rb | 4 +- .../compute}/requests/get_machine_type.rb | 4 +- .../compute}/requests/get_network.rb | 4 +- .../compute}/requests/get_project.rb | 4 +- .../compute}/requests/get_region.rb | 4 +- .../compute}/requests/get_region_operation.rb | 4 +- .../compute}/requests/get_route.rb | 4 +- .../compute}/requests/get_server.rb | 4 +- .../requests/get_server_serial_port_output.rb | 4 +- .../compute}/requests/get_snapshot.rb | 4 +- .../compute}/requests/get_ssl_certificate.rb | 4 +- .../compute}/requests/get_subnetwork.rb | 4 +- .../requests/get_target_http_proxy.rb | 4 +- .../requests/get_target_https_proxy.rb | 4 +- .../compute}/requests/get_target_instance.rb | 4 +- .../compute}/requests/get_target_pool.rb | 4 +- .../requests/get_target_pool_health.rb | 4 +- .../compute}/requests/get_url_map.rb | 4 +- .../compute}/requests/get_zone.rb | 4 +- .../compute}/requests/get_zone_operation.rb | 4 +- .../compute}/requests/insert_address.rb | 4 +- .../requests/insert_backend_service.rb | 4 +- .../compute}/requests/insert_disk.rb | 4 +- .../compute}/requests/insert_firewall.rb | 4 +- .../requests/insert_forwarding_rule.rb | 4 +- .../requests/insert_global_address.rb | 4 +- .../requests/insert_global_forwarding_rule.rb | 4 +- .../requests/insert_http_health_check.rb | 4 +- .../compute}/requests/insert_image.rb | 4 +- .../requests/insert_instance_group.rb | 4 +- .../requests/insert_instance_group_manager.rb | 4 +- .../requests/insert_instance_template.rb | 4 +- .../compute}/requests/insert_network.rb | 4 +- .../compute}/requests/insert_route.rb | 4 +- .../compute}/requests/insert_server.rb | 6 +-- .../requests/insert_ssl_certificate.rb | 4 +- .../compute}/requests/insert_subnetwork.rb | 4 +- .../requests/insert_target_http_proxy.rb | 4 +- .../requests/insert_target_https_proxy.rb | 4 +- .../requests/insert_target_instance.rb | 4 +- .../compute}/requests/insert_target_pool.rb | 4 +- .../compute}/requests/insert_url_map.rb | 4 +- .../requests/invalidate_url_map_cache.rb | 4 +- .../compute}/requests/list_addresses.rb | 4 +- .../requests/list_aggregated_addresses.rb | 4 +- .../requests/list_aggregated_disk_types.rb | 4 +- .../requests/list_aggregated_disks.rb | 4 +- .../list_aggregated_forwarding_rules.rb | 4 +- ...list_aggregated_instance_group_managers.rb | 4 +- .../list_aggregated_instance_groups.rb | 4 +- .../requests/list_aggregated_machine_types.rb | 4 +- .../requests/list_aggregated_servers.rb | 4 +- .../requests/list_aggregated_subnetworks.rb | 4 +- .../list_aggregated_target_instances.rb | 4 +- .../requests/list_aggregated_target_pools.rb | 4 +- .../requests/list_backend_services.rb | 4 +- .../compute}/requests/list_disk_types.rb | 4 +- .../compute}/requests/list_disks.rb | 4 +- .../compute}/requests/list_firewalls.rb | 4 +- .../requests/list_forwarding_rules.rb | 4 +- .../requests/list_global_addresses.rb | 4 +- .../requests/list_global_forwarding_rules.rb | 4 +- .../requests/list_global_operations.rb | 4 +- .../requests/list_http_health_checks.rb | 4 +- .../compute}/requests/list_images.rb | 4 +- .../requests/list_instance_group_instances.rb | 4 +- .../requests/list_instance_group_managers.rb | 4 +- .../compute}/requests/list_instance_groups.rb | 4 +- .../requests/list_instance_templates.rb | 4 +- .../compute}/requests/list_machine_types.rb | 4 +- .../compute}/requests/list_networks.rb | 4 +- .../requests/list_region_operations.rb | 4 +- .../compute}/requests/list_regions.rb | 4 +- .../compute}/requests/list_routes.rb | 4 +- .../compute}/requests/list_servers.rb | 4 +- .../compute}/requests/list_snapshots.rb | 4 +- .../requests/list_ssl_certificates.rb | 4 +- .../compute}/requests/list_subnetworks.rb | 4 +- .../requests/list_target_http_proxies.rb | 4 +- .../requests/list_target_https_proxies.rb | 4 +- .../requests/list_target_instances.rb | 4 +- .../compute}/requests/list_target_pools.rb | 4 +- .../compute}/requests/list_url_maps.rb | 4 +- .../compute}/requests/list_zone_operations.rb | 4 +- .../compute}/requests/list_zones.rb | 4 +- .../compute}/requests/patch_firewall.rb | 4 +- .../compute}/requests/patch_url_map.rb | 4 +- .../compute}/requests/recreate_instances.rb | 4 +- .../remove_instance_group_instances.rb | 4 +- .../remove_target_pool_health_checks.rb | 4 +- .../requests/remove_target_pool_instance.rb | 4 +- .../requests/remove_target_pool_instances.rb | 4 +- .../compute}/requests/reset_server.rb | 4 +- .../requests/set_common_instance_metadata.rb | 4 +- .../requests/set_forwarding_rule_target.rb | 4 +- .../set_global_forwarding_rule_target.rb | 4 +- .../requests/set_instance_template.rb | 4 +- .../requests/set_server_disk_auto_delete.rb | 4 +- .../compute}/requests/set_server_metadata.rb | 4 +- .../requests/set_server_scheduling.rb | 4 +- .../compute}/requests/set_server_tags.rb | 4 +- .../compute}/requests/set_snapshot_labels.rb | 4 +- ...set_subnetwork_private_ip_google_access.rb | 4 +- .../requests/set_target_http_proxy_url_map.rb | 4 +- ...set_target_https_proxy_ssl_certificates.rb | 4 +- .../set_target_https_proxy_url_map.rb | 4 +- .../requests/set_target_pool_backup.rb | 4 +- .../compute}/requests/start_server.rb | 4 +- .../compute}/requests/stop_server.rb | 4 +- .../compute}/requests/update_firewall.rb | 4 +- .../requests/update_http_health_check.rb | 4 +- .../compute}/requests/update_url_map.rb | 4 +- .../compute}/requests/validate_url_map.rb | 4 +- lib/fog/google/shared.rb | 2 +- test/helpers/test_collection.rb | 2 +- .../compute/core_compute/test_disk_types.rb | 2 +- .../compute/core_compute/test_disks.rb | 2 +- .../compute/core_compute/test_images.rb | 2 +- .../core_compute/test_machine_types.rb | 2 +- .../compute/core_compute/test_operations.rb | 2 +- .../compute/core_compute/test_projects.rb | 2 +- .../compute/core_compute/test_regions.rb | 2 +- .../compute/core_compute/test_servers.rb | 2 +- .../compute/core_compute/test_snapshots.rb | 2 +- .../compute/core_compute/test_zones.rb | 2 +- .../compute/core_networking/test_addresses.rb | 2 +- .../compute/core_networking/test_firewalls.rb | 2 +- .../compute/core_networking/test_networks.rb | 2 +- .../compute/core_networking/test_routes.rb | 2 +- .../core_networking/test_subnetworks.rb | 2 +- .../test_instance_group_managers.rb | 2 +- .../instance_groups/test_instance_groups.rb | 2 +- .../test_instance_templates.rb | 2 +- .../loadbalancing/test_backend_services.rb | 2 +- .../loadbalancing/test_forwarding_rules.rb | 2 +- .../loadbalancing/test_global_addresses.rb | 2 +- .../test_global_forwarding_rules.rb | 2 +- .../loadbalancing/test_http_health_checks.rb | 2 +- .../loadbalancing/test_ssl_certificates.rb | 2 +- .../loadbalancing/test_target_http_proxies.rb | 2 +- .../test_target_https_proxies.rb | 2 +- .../loadbalancing/test_target_instances.rb | 2 +- .../loadbalancing/test_target_pools.rb | 4 +- .../compute/loadbalancing/test_url_maps.rb | 2 +- .../factories/addresses_factory.rb | 2 +- .../factories/backend_services_factory.rb | 2 +- .../factories/collection_factory.rb | 2 +- test/integration/factories/disks_factory.rb | 2 +- .../factories/firewalls_factory.rb | 2 +- .../factories/forwarding_rules_factory.rb | 2 +- .../factories/global_addresses_factory.rb | 2 +- .../global_forwarding_rules_factory.rb | 2 +- .../factories/http_health_checks_factory.rb | 2 +- test/integration/factories/images_factory.rb | 2 +- .../instance_group_manager_factory.rb | 2 +- .../factories/instance_groups_factory.rb | 2 +- .../factories/instance_template_factory.rb | 2 +- .../integration/factories/networks_factory.rb | 2 +- test/integration/factories/servers_factory.rb | 2 +- .../factories/ssl_certificates_factory.rb | 2 +- .../factories/subnetworks_factory.rb | 2 +- .../factories/target_http_proxies_factory.rb | 2 +- .../factories/target_https_proxies_factory.rb | 2 +- .../factories/target_instances_factory.rb | 2 +- .../factories/target_pools_factory.rb | 2 +- .../integration/factories/url_maps_factory.rb | 2 +- test/integration/test_authentication.rb | 14 +++--- test/unit/compute/test_common_collections.rb | 5 +- test/unit/compute/test_common_models.rb | 19 ++++---- test/unit/compute/test_server.rb | 7 ++- 289 files changed, 686 insertions(+), 691 deletions(-) rename lib/fog/{compute/google.rb => google/compute/compute.rb} (96%) rename lib/fog/{compute/google => google/compute}/mock.rb (99%) rename lib/fog/{compute/google => google/compute}/models/address.rb (92%) rename lib/fog/{compute/google => google/compute}/models/addresses.rb (96%) rename lib/fog/{compute/google => google/compute}/models/backend_service.rb (93%) rename lib/fog/{compute/google => google/compute}/models/backend_services.rb (85%) rename lib/fog/{compute/google => google/compute}/models/disk.rb (94%) rename lib/fog/{compute/google => google/compute}/models/disk_type.rb (95%) rename lib/fog/{compute/google => google/compute}/models/disk_types.rb (93%) rename lib/fog/{compute/google => google/compute}/models/disks.rb (96%) rename lib/fog/{compute/google => google/compute}/models/firewall.rb (90%) rename lib/fog/{compute/google => google/compute}/models/firewalls.rb (85%) rename lib/fog/{compute/google => google/compute}/models/forwarding_rule.rb (93%) rename lib/fog/{compute/google => google/compute}/models/forwarding_rules.rb (93%) rename lib/fog/{compute/google => google/compute}/models/global_address.rb (89%) rename lib/fog/{compute/google => google/compute}/models/global_addresses.rb (93%) rename lib/fog/{compute/google => google/compute}/models/global_forwarding_rule.rb (93%) rename lib/fog/{compute/google => google/compute}/models/global_forwarding_rules.rb (84%) rename lib/fog/{compute/google => google/compute}/models/http_health_check.rb (92%) rename lib/fog/{compute/google => google/compute}/models/http_health_checks.rb (85%) rename lib/fog/{compute/google => google/compute}/models/image.rb (94%) rename lib/fog/{compute/google => google/compute}/models/images.rb (97%) rename lib/fog/{compute/google => google/compute}/models/instance_group.rb (98%) rename lib/fog/{compute/google => google/compute}/models/instance_group_manager.rb (94%) rename lib/fog/{compute/google => google/compute}/models/instance_group_managers.rb (93%) rename lib/fog/{compute/google => google/compute}/models/instance_groups.rb (90%) rename lib/fog/{compute/google => google/compute}/models/instance_template.rb (89%) rename lib/fog/{compute/google => google/compute}/models/instance_templates.rb (85%) rename lib/fog/{compute/google => google/compute}/models/machine_type.rb (95%) rename lib/fog/{compute/google => google/compute}/models/machine_types.rb (94%) rename lib/fog/{compute/google => google/compute}/models/network.rb (93%) rename lib/fog/{compute/google => google/compute}/models/networks.rb (85%) rename lib/fog/{compute/google => google/compute}/models/operation.rb (98%) rename lib/fog/{compute/google => google/compute}/models/operations.rb (94%) rename lib/fog/{compute/google => google/compute}/models/project.rb (88%) rename lib/fog/{compute/google => google/compute}/models/projects.rb (81%) rename lib/fog/{compute/google => google/compute}/models/region.rb (95%) rename lib/fog/{compute/google => google/compute}/models/regions.rb (85%) rename lib/fog/{compute/google => google/compute}/models/route.rb (90%) rename lib/fog/{compute/google => google/compute}/models/routes.rb (85%) rename lib/fog/{compute/google => google/compute}/models/server.rb (95%) rename lib/fog/{compute/google => google/compute}/models/servers.rb (97%) rename lib/fog/{compute/google => google/compute}/models/snapshot.rb (94%) rename lib/fog/{compute/google => google/compute}/models/snapshots.rb (90%) rename lib/fog/{compute/google => google/compute}/models/ssl_certificate.rb (88%) rename lib/fog/{compute/google => google/compute}/models/ssl_certificates.rb (85%) rename lib/fog/{compute/google => google/compute}/models/subnetwork.rb (89%) rename lib/fog/{compute/google => google/compute}/models/subnetworks.rb (93%) rename lib/fog/{compute/google => google/compute}/models/target_http_proxies.rb (85%) rename lib/fog/{compute/google => google/compute}/models/target_http_proxy.rb (89%) rename lib/fog/{compute/google => google/compute}/models/target_https_proxies.rb (85%) rename lib/fog/{compute/google => google/compute}/models/target_https_proxy.rb (89%) rename lib/fog/{compute/google => google/compute}/models/target_instance.rb (91%) rename lib/fog/{compute/google => google/compute}/models/target_instances.rb (94%) rename lib/fog/{compute/google => google/compute}/models/target_pool.rb (93%) rename lib/fog/{compute/google => google/compute}/models/target_pools.rb (93%) rename lib/fog/{compute/google => google/compute}/models/url_map.rb (91%) rename lib/fog/{compute/google => google/compute}/models/url_maps.rb (85%) rename lib/fog/{compute/google => google/compute}/models/zone.rb (93%) rename lib/fog/{compute/google => google/compute}/models/zones.rb (85%) rename lib/fog/{compute/google => google/compute}/real.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/abandon_instances.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/add_backend_service_backends.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/add_instance_group_instances.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/add_server_access_config.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/add_target_pool_health_checks.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/add_target_pool_instances.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/attach_disk.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/create_disk_snapshot.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/delete_address.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/delete_backend_service.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/delete_disk.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/delete_firewall.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_forwarding_rule.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/delete_global_address.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_global_forwarding_rule.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_global_operation.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/delete_http_health_check.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_image.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_instance_group.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_instance_group_manager.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_instance_template.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_network.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_region_operation.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/delete_route.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/delete_server.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_server_access_config.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/delete_snapshot.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_ssl_certificate.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_subnetwork.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/delete_target_http_proxy.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_target_https_proxy.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/delete_target_instance.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/delete_target_pool.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/delete_url_map.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/delete_zone_operation.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/deprecate_image.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/detach_disk.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/expand_subnetwork_ip_cidr_range.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/get_address.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/get_backend_service.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/get_backend_service_health.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/get_disk.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/get_disk_type.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_firewall.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_forwarding_rule.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/get_global_address.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_global_forwarding_rule.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_global_operation.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/get_http_health_check.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_image.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_image_from_family.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/get_instance_group.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_instance_group_manager.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/get_instance_template.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_machine_type.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_network.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_project.rb (88%) rename lib/fog/{compute/google => google/compute}/requests/get_region.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_region_operation.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/get_route.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/get_server.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_server_serial_port_output.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/get_snapshot.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_ssl_certificate.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/get_subnetwork.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/get_target_http_proxy.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_target_https_proxy.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_target_instance.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_target_pool.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/get_target_pool_health.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/get_url_map.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/get_zone.rb (88%) rename lib/fog/{compute/google => google/compute}/requests/get_zone_operation.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/insert_address.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/insert_backend_service.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/insert_disk.rb (98%) rename lib/fog/{compute/google => google/compute}/requests/insert_firewall.rb (98%) rename lib/fog/{compute/google => google/compute}/requests/insert_forwarding_rule.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/insert_global_address.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/insert_global_forwarding_rule.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/insert_http_health_check.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/insert_image.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/insert_instance_group.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/insert_instance_group_manager.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/insert_instance_template.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/insert_network.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/insert_route.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/insert_server.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/insert_ssl_certificate.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/insert_subnetwork.rb (98%) rename lib/fog/{compute/google => google/compute}/requests/insert_target_http_proxy.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/insert_target_https_proxy.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/insert_target_instance.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/insert_target_pool.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/insert_url_map.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/invalidate_url_map_cache.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_addresses.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_addresses.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_disk_types.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_disks.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_forwarding_rules.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_instance_group_managers.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_instance_groups.rb (90%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_machine_types.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_servers.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_subnetworks.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_target_instances.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_aggregated_target_pools.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_backend_services.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_disk_types.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_disks.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_firewalls.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_forwarding_rules.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_global_addresses.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_global_forwarding_rules.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_global_operations.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_http_health_checks.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_images.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_instance_group_instances.rb (92%) rename lib/fog/{compute/google => google/compute}/requests/list_instance_group_managers.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_instance_groups.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/list_instance_templates.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_machine_types.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_networks.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_region_operations.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_regions.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_routes.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_servers.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_snapshots.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_ssl_certificates.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_subnetworks.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/list_target_http_proxies.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_target_https_proxies.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/list_target_instances.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_target_pools.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_url_maps.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/list_zone_operations.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/list_zones.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/patch_firewall.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/patch_url_map.rb (91%) rename lib/fog/{compute/google => google/compute}/requests/recreate_instances.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/remove_instance_group_instances.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/remove_target_pool_health_checks.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/remove_target_pool_instance.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/remove_target_pool_instances.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/reset_server.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/set_common_instance_metadata.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/set_forwarding_rule_target.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_global_forwarding_rule_target.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_instance_template.rb (96%) rename lib/fog/{compute/google => google/compute}/requests/set_server_disk_auto_delete.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/set_server_metadata.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/set_server_scheduling.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/set_server_tags.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_snapshot_labels.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_subnetwork_private_ip_google_access.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/set_target_http_proxy_url_map.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_target_https_proxy_ssl_certificates.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/set_target_https_proxy_url_map.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/set_target_pool_backup.rb (95%) rename lib/fog/{compute/google => google/compute}/requests/start_server.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/stop_server.rb (89%) rename lib/fog/{compute/google => google/compute}/requests/update_firewall.rb (97%) rename lib/fog/{compute/google => google/compute}/requests/update_http_health_check.rb (93%) rename lib/fog/{compute/google => google/compute}/requests/update_url_map.rb (94%) rename lib/fog/{compute/google => google/compute}/requests/validate_url_map.rb (93%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b59c64bda..794f720543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Fixed -- \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url` +- \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url` request ## 1.7.0 @@ -70,17 +70,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Added - \#409 Support query parameters in `Fog::Storage::Google` GET requests [stanhu] -- \#394 Add some helper methods to `Fog::Compute::Google::Server` [temikus] +- \#394 Add some helper methods to `Fog::Google::Compute::Server` [temikus] - `.private_ip_address` - `.stopped?` - \#375 Add timeout options to `Fog::Storage::GoogleJSON` client [dosuken123] #### Changed -- \#394 `save/update/destroy` and other operations now wait until they are in a - DONE state, instead of !PENDING. This should be a no-op for users but should +- \#394 `save/update/destroy` and other operations now wait until they are in a + DONE state, instead of !PENDING. This should be a no-op for users but should safeguard from issues in the future. [temikus] -- \#383 `Fog::Compute::Google::Address` resources are now created synchronously +- \#383 `Fog::Google::Compute::Address` resources are now created synchronously by default. [temikus] ### Development changes @@ -96,7 +96,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html - \#376 Add doc coverage tracking. [temikus] - \#383 Increase integration test coverage further. [temikus] - Add collection tests and factories (when mutable) for following resources: - - Addresses + - Addresses - Disks - Projects - Routes @@ -120,23 +120,23 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Changed -- \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default. +- \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default. You can override it in a standard manner by passing a parameter to async method, e.g.: `Fog::Google::SQL::Instance.create(true)` [temikus] -- \#367 `Fog::Compute::Google::Server.bootstrap` changes [temikus] +- \#367 `Fog::Google::Compute::Server.bootstrap` changes [temikus] - Now creates instances with disks that automatically delete on instance shutdown. - Now creates instances with a public IP address by default. #### Added -- \#361 `Fog::Compute::Google::Server` now recognises `network_ip` attribute to specify internal IP. [mattimatti] +- \#361 `Fog::Google::Compute::Server` now recognises `network_ip` attribute to specify internal IP. [mattimatti] #### Fixed - \#338 Fixed SQL Users model workflow [temikus] - \#359 Fix whitespace escaping in XML Storage methods [temikus] - \#366 Fixing `Server` model to properly accept `:private_key_path` and `:public_key_path` attributes again. [temikus] -- \#367 `Fog::Compute::Google::Server.bootstrap` parameters are now properly merged with default ones. [tesmikus] +- \#367 `Fog::Google::Compute::Server.bootstrap` parameters are now properly merged with default ones. [tesmikus] ### Development changes @@ -155,7 +155,7 @@ You can override it in a standard manner by passing a parameter to async method, - \#348 Added Instance Group Manager and Instance Templates [bpaquet] - - `Fog::Compute::Google::InstanceGroupManager` model and associated requests: + - `Fog::Google::Compute::InstanceGroupManager` model and associated requests: - `:get_instance_group_manager` - `:insert_instance_group_manager` - `:delete_instance_group_manager` @@ -164,7 +164,7 @@ You can override it in a standard manner by passing a parameter to async method, - `:recreate_instances` - `:abandon_instances` - - `Fog::Compute::Google::InstanceTemplate` model and associated requests: + - `Fog::Google::Compute::InstanceTemplate` model and associated requests: - `:list_instance_templates` - `:get_instance_template` - `:insert_instance_template` @@ -188,31 +188,31 @@ You can override it in a standard manner by passing a parameter to async method, #### Added -- \#336 `Fog::Compute::Google::Server.set_metadata` is now working properly and adopted a simpler format, e.g. `{'foo' => 'bar', 'baz'=>'foo'}` -- \#334 Added a new helper method: `Fog::Compute::Google::Server.public_ip_address` [temikus] -- \#314 Added `Fog::Compute::Google::InstanceGroup.add_instance` method back [temikus] +- \#336 `Fog::Google::Compute::Server.set_metadata` is now working properly and adopted a simpler format, e.g. `{'foo' => 'bar', 'baz'=>'foo'}` +- \#334 Added a new helper method: `Fog::Google::Compute::Server.public_ip_address` [temikus] +- \#314 Added `Fog::Google::Compute::InstanceGroup.add_instance` method back [temikus] - \#326 Added support for using predefined ACLs, refactor valid ACLs [vimutter] - \#318 Added fog_public support in Storage JSON API [jayhsu21] #### Fixed -- \#354 Bump Google API client to 0.23 [temikus] -- \#346 Fixed get_health when called with an instance name [bpaquet] -- \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus] -- \#321 Fix string key instead of symbol for subnetworks listing [tumido] -- \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter] +- \#354 Bump Google API client to 0.23 [temikus] +- \#346 Fixed get_health when called with an instance name [bpaquet] +- \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus] +- \#321 Fix string key instead of symbol for subnetworks listing [tumido] +- \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter] ### Development changes #### Added -- \#353 Added collection/model unit tests to be run by Travis CI [temikus] -- \#347 Added target pool tests [temikus] +- \#353 Added collection/model unit tests to be run by Travis CI [temikus] +- \#347 Added target pool tests [temikus] #### Fixed - \#322 Fixed all broken integration tests, all tests now pass in CI [temikus] -- \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus] +- \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus] ## 1.0.1 @@ -274,4 +274,4 @@ We encourage people using 0.5.1 to upgrade. #### Added -#### Fixed \ No newline at end of file +#### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef45ddd974..406e57b11c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,9 @@ # Getting Involved -New contributors are always welcome, and when in doubt please ask questions! +New contributors are always welcome, and when in doubt please ask questions! We strive to be an open and welcoming community. Please be nice to one another. -We recommend heading over to fog's [CONTRIBUTING](https://github.com/fog/fog/blob/master/CONTRIBUTING.md) +We recommend heading over to fog's [CONTRIBUTING](https://github.com/fog/fog/blob/master/CONTRIBUTING.md) and having a look around as well. It has information and context about the state of the `fog` project as a whole. ### Coding @@ -62,7 +62,7 @@ $ rake console ### Documentation Code should be documented using [YARDoc](https://yardoc.org/) syntax. -We use [inch](https://github.com/rrrene/inch) to keep track of overall doc +We use [inch](https://github.com/rrrene/inch) to keep track of overall doc coverage and [inch-ci](https://inch-ci.org/) to keep track of changes over time. You can view a doc coverage report by running: @@ -72,19 +72,19 @@ $ inch Or view suggestions on a specific method: ``` -$ inch show Fog::Compute::Google::Server#set_metadata +$ inch show Fog::Google::Compute::Server#set_metadata ``` ### Testing -This module is tested with [Minitest](https://github.com/seattlerb/minitest). +This module is tested with [Minitest](https://github.com/seattlerb/minitest). #### Integration tests -Live integration tests can be found in `test/integration/`. +Live integration tests can be found in `test/integration/`. Most of the library functionality is currently covered with them. To simplify things for contributors we have a -CI system that runs all integration tests in parallel against all pull requests marked with `integrate` label +CI system that runs all integration tests in parallel against all pull requests marked with `integrate` label that anyone in `fog-google` team can set. Read [CI section](https://github.com/fog/fog-google/blob/master/CONTRIBUTING.md#continuous-integration) for more info. @@ -138,7 +138,7 @@ We're in progress of extending the library with more unit tests and contribution #### The transition from `shindo` to Minitest -Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework. +Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework. We've moved away from it, and to Minitest, but some artifacts may remain. For more information on transition, read [#50](https://github.com/fog/fog-google/issues/50). @@ -159,10 +159,10 @@ and contains the standard tests to run for all resources, (e.g. `test_lifecycle` It also calls `cleanup` on the resource's factory during teardown, to make sure that resources are getting destroyed before the next test run. - The **factory**, (e.g. `ServersFactory`, in `test/integration/factories/servers_factory.rb`,) -automates the creation of resources and/or supplies parameters for explicit +automates the creation of resources and/or supplies parameters for explicit creation of resources. For example, `ServersFactory` initializes a `DisksFactory` to supply disks in order to create servers, and implements the `params` method -so that tests can create servers with unique names, correct zones and machine +so that tests can create servers with unique names, correct zones and machine types, and automatically-created disks. `ServersFactory` inherits the `create` method from `CollectionFactory`, which allows tests to create servers on-demand. - The **main test**, (e.g. `TestServers`, in `test/integration/compute/test_servers.rb`,) @@ -171,6 +171,6 @@ method from `CollectionFactory`, which allows tests to create servers on-demand. it initializes a `ServersFactory`, and it includes any other tests specific to this collection, (e.g. `test_bootstrap_ssh_destroy`). -If you want to create another resource, you should add live integration tests; +If you want to create another resource, you should add live integration tests; all you need to do is create a factory in `test/integration/factories/my_resource_factory.rb` and a main test in `test/integration/compute/test_my_resource.rb` that mixes in `TestCollection`. diff --git a/README.md b/README.md index bc557681a5..00c4f3eed7 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ There are two ways to access [Google Cloud Storage](https://cloud.google.com/sto Google Compute Engine is a Virtual Machine hosting service. Currently it is built on version [v1](https://cloud.google.com/compute/docs/reference/v1/) of the GCE API. -As of 2017-12-15, we are still working on making Fog for Google Compute engine (`Fog::Compute::Google`) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like. +As of 2017-12-15, we are still working on making Fog for Google Compute engine (`Fog::Google::Compute`) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like. ## SQL -Fog implements [v1beta4](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/) of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like as we finish -adding remaining features. +Fog implements [v1beta4](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/) of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like as we finish +adding remaining features. ## DNS @@ -36,8 +36,8 @@ Fog implements [v1](https://cloud.google.com/dns/api/v1/) of the Google Cloud DN ## Monitoring -Fog implements [v3](https://cloud.google.com/monitoring/api/v3/) of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups. - +Fog implements [v3](https://cloud.google.com/monitoring/api/v3/) of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups. + We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like. ## Pubsub @@ -105,9 +105,9 @@ Once you've specified your credentials, you should be good to go! $ bundle exec pry [1] pry(main)> require 'fog/google' => true -[2] pry(main)> connection = Fog::Compute::Google.new +[2] pry(main)> connection = Fog::Google::Compute.new [3] pry(main)> connection.servers -=> [ [ service) .get(data.name, nil, data.region) operation.wait_for { ready? } @@ -48,7 +48,7 @@ def destroy(async = true) requires :identity, :region data = service.delete_address(identity, region.split("/")[-1]) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) @@ -80,7 +80,7 @@ def associate(nic_name, async = true) data = service.add_server_access_config( server.name, server.zone, nic_name, :nat_ip => address ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -107,7 +107,7 @@ def disassociate data = service.delete_server_access_config( server.name, server.zone, nic[:name], access_config[:name] ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async diff --git a/lib/fog/compute/google/models/addresses.rb b/lib/fog/google/compute/models/addresses.rb similarity index 96% rename from lib/fog/compute/google/models/addresses.rb rename to lib/fog/google/compute/models/addresses.rb index dcbef112d2..2c0658facb 100755 --- a/lib/fog/compute/google/models/addresses.rb +++ b/lib/fog/google/compute/models/addresses.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Addresses < Fog::Collection - model Fog::Compute::Google::Address + model Fog::Google::Compute::Address def all(region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) opts = { diff --git a/lib/fog/compute/google/models/backend_service.rb b/lib/fog/google/compute/models/backend_service.rb similarity index 93% rename from lib/fog/compute/google/models/backend_service.rb rename to lib/fog/google/compute/models/backend_service.rb index 838570b8a8..3b24bf154b 100644 --- a/lib/fog/compute/google/models/backend_service.rb +++ b/lib/fog/google/compute/models/backend_service.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class BackendService < Fog::Model identity :name @@ -30,7 +30,7 @@ def save } data = service.insert_backend_service(name, options) - operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name) + operation = Fog::Google::Compute::Operations.new(:service => service).get(data.name) operation.wait_for { ready? } reload end @@ -39,7 +39,7 @@ def destroy(async = true) requires :name data = service.delete_backend_service(name) - operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name) + operation = Fog::Google::Compute::Operations.new(:service => service).get(data.name) operation.wait_for { ready? } unless async operation end diff --git a/lib/fog/compute/google/models/backend_services.rb b/lib/fog/google/compute/models/backend_services.rb similarity index 85% rename from lib/fog/compute/google/models/backend_services.rb rename to lib/fog/google/compute/models/backend_services.rb index 5e7d7d1335..88a659309a 100644 --- a/lib/fog/compute/google/models/backend_services.rb +++ b/lib/fog/google/compute/models/backend_services.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class BackendServices < Fog::Collection - model Fog::Compute::Google::BackendService + model Fog::Google::Compute::BackendService def all(_filters = {}) data = service.list_backend_services.items || [] diff --git a/lib/fog/compute/google/models/disk.rb b/lib/fog/google/compute/models/disk.rb similarity index 94% rename from lib/fog/compute/google/models/disk.rb rename to lib/fog/google/compute/models/disk.rb index f00df2be33..b76e9ac074 100644 --- a/lib/fog/compute/google/models/disk.rb +++ b/lib/fog/google/compute/models/disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Disk < Fog::Model identity :name @@ -48,7 +48,7 @@ def save # Request needs backward compatibility so source image is specified in # method arguments data = service.insert_disk(name, zone, options[:source_image], options) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } reload @@ -58,7 +58,7 @@ def destroy(async = true) requires :name, :zone data = service.delete_disk(name, zone_name) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async operation @@ -106,7 +106,7 @@ def create_snapshot(snapshot_name, snapshot = {}) raise ArgumentError, "Invalid snapshot name" unless snapshot_name data = service.create_disk_snapshot(snapshot_name, name, zone_name, snapshot) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } service.snapshots.get(snapshot_name) diff --git a/lib/fog/compute/google/models/disk_type.rb b/lib/fog/google/compute/models/disk_type.rb similarity index 95% rename from lib/fog/compute/google/models/disk_type.rb rename to lib/fog/google/compute/models/disk_type.rb index 6502e5d631..97dafd843c 100644 --- a/lib/fog/compute/google/models/disk_type.rb +++ b/lib/fog/google/compute/models/disk_type.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class DiskType < Fog::Model identity :name diff --git a/lib/fog/compute/google/models/disk_types.rb b/lib/fog/google/compute/models/disk_types.rb similarity index 93% rename from lib/fog/compute/google/models/disk_types.rb rename to lib/fog/google/compute/models/disk_types.rb index 6e424ed62e..81fa6518f8 100644 --- a/lib/fog/compute/google/models/disk_types.rb +++ b/lib/fog/google/compute/models/disk_types.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class DiskTypes < Fog::Collection - model Fog::Compute::Google::DiskType + model Fog::Google::Compute::DiskType def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/disks.rb b/lib/fog/google/compute/models/disks.rb similarity index 96% rename from lib/fog/compute/google/models/disks.rb rename to lib/fog/google/compute/models/disks.rb index d7fe166e88..3065672d9b 100644 --- a/lib/fog/compute/google/models/disks.rb +++ b/lib/fog/google/compute/models/disks.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Disks < Fog::Collection - model Fog::Compute::Google::Disk + model Fog::Google::Compute::Disk def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/firewall.rb b/lib/fog/google/compute/models/firewall.rb similarity index 90% rename from lib/fog/compute/google/models/firewall.rb rename to lib/fog/google/compute/models/firewall.rb index b10b9edf6d..4514e97776 100644 --- a/lib/fog/compute/google/models/firewall.rb +++ b/lib/fog/google/compute/models/firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Firewall resource # @@ -53,7 +53,7 @@ def save def create data = service.insert_firewall(identity, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -63,7 +63,7 @@ def update requires :identity, :allowed, :network data = service.update_firewall(identity, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -73,7 +73,7 @@ def patch(diff = {}) requires :identity data = service.patch_firewall(identity, diff) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -83,7 +83,7 @@ def destroy(async = true) requires :identity data = service.delete_firewall(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/firewalls.rb b/lib/fog/google/compute/models/firewalls.rb similarity index 85% rename from lib/fog/compute/google/models/firewalls.rb rename to lib/fog/google/compute/models/firewalls.rb index 854b4a1daa..cb4189d7ef 100644 --- a/lib/fog/compute/google/models/firewalls.rb +++ b/lib/fog/google/compute/models/firewalls.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Firewalls < Fog::Collection - model Fog::Compute::Google::Firewall + model Fog::Google::Compute::Firewall def all(opts = {}) data = service.list_firewalls(opts).to_h[:items] diff --git a/lib/fog/compute/google/models/forwarding_rule.rb b/lib/fog/google/compute/models/forwarding_rule.rb similarity index 93% rename from lib/fog/compute/google/models/forwarding_rule.rb rename to lib/fog/google/compute/models/forwarding_rule.rb index 83a150dcaa..2a0c97653e 100644 --- a/lib/fog/compute/google/models/forwarding_rule.rb +++ b/lib/fog/google/compute/models/forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class ForwardingRule < Fog::Model identity :name @@ -25,7 +25,7 @@ def save requires :identity, :region data = service.insert_forwarding_rule(identity, region, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } reload @@ -45,7 +45,7 @@ def set_target(new_target) def destroy(async = true) requires :identity, :region data = service.delete_forwarding_rule(identity, region) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/forwarding_rules.rb b/lib/fog/google/compute/models/forwarding_rules.rb similarity index 93% rename from lib/fog/compute/google/models/forwarding_rules.rb rename to lib/fog/google/compute/models/forwarding_rules.rb index 46739b135a..d1bf2db51e 100644 --- a/lib/fog/compute/google/models/forwarding_rules.rb +++ b/lib/fog/google/compute/models/forwarding_rules.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class ForwardingRules < Fog::Collection - model Fog::Compute::Google::ForwardingRule + model Fog::Google::Compute::ForwardingRule def all(region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) opts = { diff --git a/lib/fog/compute/google/models/global_address.rb b/lib/fog/google/compute/models/global_address.rb similarity index 89% rename from lib/fog/compute/google/models/global_address.rb rename to lib/fog/google/compute/models/global_address.rb index 136fc0b442..3957b3090c 100644 --- a/lib/fog/compute/google/models/global_address.rb +++ b/lib/fog/google/compute/models/global_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents an Address resource # @@ -25,7 +25,7 @@ def save requires :identity data = service.insert_global_address(identity, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -35,7 +35,7 @@ def destroy(async = true) requires :identity data = service.delete_global_address(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/global_addresses.rb b/lib/fog/google/compute/models/global_addresses.rb similarity index 93% rename from lib/fog/compute/google/models/global_addresses.rb rename to lib/fog/google/compute/models/global_addresses.rb index 76ba049d7b..3677340fe3 100644 --- a/lib/fog/compute/google/models/global_addresses.rb +++ b/lib/fog/google/compute/models/global_addresses.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class GlobalAddresses < Fog::Collection - model Fog::Compute::Google::GlobalAddress + model Fog::Google::Compute::GlobalAddress def all(options = {}) data = service.list_global_addresses(options).to_h[:items] || [] diff --git a/lib/fog/compute/google/models/global_forwarding_rule.rb b/lib/fog/google/compute/models/global_forwarding_rule.rb similarity index 93% rename from lib/fog/compute/google/models/global_forwarding_rule.rb rename to lib/fog/google/compute/models/global_forwarding_rule.rb index 75468015bb..9b7a2f8760 100644 --- a/lib/fog/compute/google/models/global_forwarding_rule.rb +++ b/lib/fog/google/compute/models/global_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class GlobalForwardingRule < Fog::Model identity :name @@ -25,7 +25,7 @@ def save requires :identity data = service.insert_global_forwarding_rule(identity, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } reload @@ -34,7 +34,7 @@ def save def destroy(async = true) requires :identity data = service.delete_global_forwarding_rule(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/global_forwarding_rules.rb b/lib/fog/google/compute/models/global_forwarding_rules.rb similarity index 84% rename from lib/fog/compute/google/models/global_forwarding_rules.rb rename to lib/fog/google/compute/models/global_forwarding_rules.rb index 9009951fca..62a4e79ec9 100644 --- a/lib/fog/compute/google/models/global_forwarding_rules.rb +++ b/lib/fog/google/compute/models/global_forwarding_rules.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class GlobalForwardingRules < Fog::Collection - model Fog::Compute::Google::GlobalForwardingRule + model Fog::Google::Compute::GlobalForwardingRule def all(opts = {}) data = service.list_global_forwarding_rules(opts).to_h[:items] || [] diff --git a/lib/fog/compute/google/models/http_health_check.rb b/lib/fog/google/compute/models/http_health_check.rb similarity index 92% rename from lib/fog/compute/google/models/http_health_check.rb rename to lib/fog/google/compute/models/http_health_check.rb index 9eb054b6cc..4592c3b163 100644 --- a/lib/fog/compute/google/models/http_health_check.rb +++ b/lib/fog/google/compute/models/http_health_check.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class HttpHealthCheck < Fog::Model identity :name @@ -51,7 +51,7 @@ def create(opts) requires :name data = service.insert_http_health_check(name, opts) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } reload @@ -60,7 +60,7 @@ def create(opts) def update(opts) requires :name data = service.update_http_health_check(name, opts) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } reload @@ -69,7 +69,7 @@ def update(opts) def destroy(async = true) requires :name data = service.delete_http_health_check(name) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/http_health_checks.rb b/lib/fog/google/compute/models/http_health_checks.rb similarity index 85% rename from lib/fog/compute/google/models/http_health_checks.rb rename to lib/fog/google/compute/models/http_health_checks.rb index eedc3f2102..f31e43f69d 100644 --- a/lib/fog/compute/google/models/http_health_checks.rb +++ b/lib/fog/google/compute/models/http_health_checks.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class HttpHealthChecks < Fog::Collection - model Fog::Compute::Google::HttpHealthCheck + model Fog::Google::Compute::HttpHealthCheck def all(_filters = {}) data = service.list_http_health_checks.to_h[:items] || [] diff --git a/lib/fog/compute/google/models/image.rb b/lib/fog/google/compute/models/image.rb similarity index 94% rename from lib/fog/compute/google/models/image.rb rename to lib/fog/google/compute/models/image.rb index 221beac250..d27ef70373 100644 --- a/lib/fog/compute/google/models/image.rb +++ b/lib/fog/google/compute/models/image.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Image < Fog::Model identity :name @@ -49,7 +49,7 @@ def ready? def destroy(async = true) data = service.delete_image(name) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation @@ -66,7 +66,7 @@ def save requires :name data = service.insert_image(name, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload diff --git a/lib/fog/compute/google/models/images.rb b/lib/fog/google/compute/models/images.rb similarity index 97% rename from lib/fog/compute/google/models/images.rb rename to lib/fog/google/compute/models/images.rb index 0785f37950..485e19d033 100644 --- a/lib/fog/compute/google/models/images.rb +++ b/lib/fog/google/compute/models/images.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Images < Fog::Collection - model Fog::Compute::Google::Image + model Fog::Google::Compute::Image # NOTE: some of these operating systems are premium and users will be # charged a license fee beyond the base Google Compute Engine VM diff --git a/lib/fog/compute/google/models/instance_group.rb b/lib/fog/google/compute/models/instance_group.rb similarity index 98% rename from lib/fog/compute/google/models/instance_group.rb rename to lib/fog/google/compute/models/instance_group.rb index 4434097ff6..854b0e1ef4 100644 --- a/lib/fog/compute/google/models/instance_group.rb +++ b/lib/fog/google/compute/models/instance_group.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceGroup < Fog::Model identity :name diff --git a/lib/fog/compute/google/models/instance_group_manager.rb b/lib/fog/google/compute/models/instance_group_manager.rb similarity index 94% rename from lib/fog/compute/google/models/instance_group_manager.rb rename to lib/fog/google/compute/models/instance_group_manager.rb index 7bb0baa7bb..8ff284328d 100644 --- a/lib/fog/compute/google/models/instance_group_manager.rb +++ b/lib/fog/google/compute/models/instance_group_manager.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceGroupManager < Fog::Model identity :name @@ -22,7 +22,7 @@ def save data = service.insert_instance_group_manager(name, zone.split("/")[-1], instance_template, base_instance_name, target_size, target_pools, named_ports, description) - operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name, zone.split("/")[-1]) + operation = Fog::Google::Compute::Operations.new(:service => service).get(data.name, zone.split("/")[-1]) operation.wait_for { ready? } reload end diff --git a/lib/fog/compute/google/models/instance_group_managers.rb b/lib/fog/google/compute/models/instance_group_managers.rb similarity index 93% rename from lib/fog/compute/google/models/instance_group_managers.rb rename to lib/fog/google/compute/models/instance_group_managers.rb index 169a71e86c..356f92a1fe 100644 --- a/lib/fog/compute/google/models/instance_group_managers.rb +++ b/lib/fog/google/compute/models/instance_group_managers.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceGroupManagers < Fog::Collection - model Fog::Compute::Google::InstanceGroupManager + model Fog::Google::Compute::InstanceGroupManager def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/instance_groups.rb b/lib/fog/google/compute/models/instance_groups.rb similarity index 90% rename from lib/fog/compute/google/models/instance_groups.rb rename to lib/fog/google/compute/models/instance_groups.rb index ba0e7f1e10..f385dccefa 100644 --- a/lib/fog/compute/google/models/instance_groups.rb +++ b/lib/fog/google/compute/models/instance_groups.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceGroups < Fog::Collection - model Fog::Compute::Google::InstanceGroup + model Fog::Google::Compute::InstanceGroup def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) opts = { @@ -43,7 +43,7 @@ def get(identity, zone = nil) # TODO: To be deprecated def add_instance(params) Fog::Logger.deprecation( - "#{self.class}.#{__method__} is deprecated, use Fog::Compute::Google::InstanceGroup.#{__method__} instead [light_black](#{caller(0..0)})[/]" + "#{self.class}.#{__method__} is deprecated, use Fog::Google::Compute::InstanceGroup.#{__method__} instead [light_black](#{caller(0..0)})[/]" ) params[:instance] = [params[:instance]] unless params[:instance] == Array service.add_instance_group_instances(params[:group], params[:zone], params[:instance]) @@ -52,7 +52,7 @@ def add_instance(params) # TODO: To be deprecated def remove_instance(params) Fog::Logger.deprecation( - "#{self.class}.#{__method__} is deprecated, use Fog::Compute::Google::InstanceGroup.#{__method__} instead [light_black](#{caller(0..0)})[/]" + "#{self.class}.#{__method__} is deprecated, use Fog::Google::Compute::InstanceGroup.#{__method__} instead [light_black](#{caller(0..0)})[/]" ) params[:instance] = [params[:instance]] unless params[:instance] == Array service.remove_instance_group_instances(params[:group], params[:zone], params[:instance]) diff --git a/lib/fog/compute/google/models/instance_template.rb b/lib/fog/google/compute/models/instance_template.rb similarity index 89% rename from lib/fog/compute/google/models/instance_template.rb rename to lib/fog/google/compute/models/instance_template.rb index e947a54045..15ac0244bc 100644 --- a/lib/fog/compute/google/models/instance_template.rb +++ b/lib/fog/google/compute/models/instance_template.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceTemplate < Fog::Model identity :name @@ -29,7 +29,7 @@ def save requires :properties data = service.insert_instance_template(name, properties, description) - operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name) + operation = Fog::Google::Compute::Operations.new(:service => service).get(data.name) operation.wait_for { ready? } reload end @@ -37,7 +37,7 @@ def save def destroy(async = true) requires :name data = service.delete_instance_template(name) - operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name) + operation = Fog::Google::Compute::Operations.new(:service => service).get(data.name) operation.wait_for { ready? } unless async operation end diff --git a/lib/fog/compute/google/models/instance_templates.rb b/lib/fog/google/compute/models/instance_templates.rb similarity index 85% rename from lib/fog/compute/google/models/instance_templates.rb rename to lib/fog/google/compute/models/instance_templates.rb index d211c918e6..562dbcd803 100644 --- a/lib/fog/compute/google/models/instance_templates.rb +++ b/lib/fog/google/compute/models/instance_templates.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class InstanceTemplates < Fog::Collection - model Fog::Compute::Google::InstanceTemplate + model Fog::Google::Compute::InstanceTemplate def all data = service.list_instance_templates.items || [] diff --git a/lib/fog/compute/google/models/machine_type.rb b/lib/fog/google/compute/models/machine_type.rb similarity index 95% rename from lib/fog/compute/google/models/machine_type.rb rename to lib/fog/google/compute/models/machine_type.rb index 91be25ffb2..3fea4ba714 100644 --- a/lib/fog/compute/google/models/machine_type.rb +++ b/lib/fog/google/compute/models/machine_type.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class MachineType < Fog::Model identity :name diff --git a/lib/fog/compute/google/models/machine_types.rb b/lib/fog/google/compute/models/machine_types.rb similarity index 94% rename from lib/fog/compute/google/models/machine_types.rb rename to lib/fog/google/compute/models/machine_types.rb index 8d9e8490f1..90e040c199 100644 --- a/lib/fog/compute/google/models/machine_types.rb +++ b/lib/fog/google/compute/models/machine_types.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class MachineTypes < Fog::Collection - model Fog::Compute::Google::MachineType + model Fog::Google::Compute::MachineType def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) opts = { diff --git a/lib/fog/compute/google/models/network.rb b/lib/fog/google/compute/models/network.rb similarity index 93% rename from lib/fog/compute/google/models/network.rb rename to lib/fog/google/compute/models/network.rb index 37e7e182c2..e504675328 100755 --- a/lib/fog/compute/google/models/network.rb +++ b/lib/fog/google/compute/models/network.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Network resource # @@ -30,7 +30,7 @@ def save requires :identity, :ipv4_range data = service.insert_network(identity, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) # Since network has no "state" we can query, we have to wait for the operation to finish # TODO: change back to async when there's a proper state API @@ -42,7 +42,7 @@ def destroy(async = true) requires :identity data = service.delete_network(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/networks.rb b/lib/fog/google/compute/models/networks.rb similarity index 85% rename from lib/fog/compute/google/models/networks.rb rename to lib/fog/google/compute/models/networks.rb index c8922f079e..6379d0c3ad 100644 --- a/lib/fog/compute/google/models/networks.rb +++ b/lib/fog/google/compute/models/networks.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Networks < Fog::Collection - model Fog::Compute::Google::Network + model Fog::Google::Compute::Network def all data = service.list_networks.to_h[:items] diff --git a/lib/fog/compute/google/models/operation.rb b/lib/fog/google/compute/models/operation.rb similarity index 98% rename from lib/fog/compute/google/models/operation.rb rename to lib/fog/google/compute/models/operation.rb index 8c4691762e..3dda4adac0 100644 --- a/lib/fog/compute/google/models/operation.rb +++ b/lib/fog/google/compute/models/operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Operation < Fog::Model identity :name diff --git a/lib/fog/compute/google/models/operations.rb b/lib/fog/google/compute/models/operations.rb similarity index 94% rename from lib/fog/compute/google/models/operations.rb rename to lib/fog/google/compute/models/operations.rb index 00cadf6e71..533145848b 100644 --- a/lib/fog/compute/google/models/operations.rb +++ b/lib/fog/google/compute/models/operations.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Operations < Fog::Collection - model Fog::Compute::Google::Operation + model Fog::Google::Compute::Operation def all(zone: nil, region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/project.rb b/lib/fog/google/compute/models/project.rb similarity index 88% rename from lib/fog/compute/google/models/project.rb rename to lib/fog/google/compute/models/project.rb index 9767ac9d9f..bb0d3e7391 100644 --- a/lib/fog/compute/google/models/project.rb +++ b/lib/fog/google/compute/models/project.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Project resource # @@ -20,7 +20,7 @@ def set_metadata(metadata = {}) requires :identity operation = service.set_common_instance_metadata(identity, common_instance_metadata["fingerprint"], metadata) - Fog::Compute::Google::Operations.new(:service => service).get(operation.id) + Fog::Google::Compute::Operations.new(:service => service).get(operation.id) end end end diff --git a/lib/fog/compute/google/models/projects.rb b/lib/fog/google/compute/models/projects.rb similarity index 81% rename from lib/fog/compute/google/models/projects.rb rename to lib/fog/google/compute/models/projects.rb index 9de7110ad2..dfef3cd7ed 100644 --- a/lib/fog/compute/google/models/projects.rb +++ b/lib/fog/google/compute/models/projects.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Projects < Fog::Collection - model Fog::Compute::Google::Project + model Fog::Google::Compute::Project def get(identity) if identity diff --git a/lib/fog/compute/google/models/region.rb b/lib/fog/google/compute/models/region.rb similarity index 95% rename from lib/fog/compute/google/models/region.rb rename to lib/fog/google/compute/models/region.rb index 16a60125ac..a57bd9d7e8 100755 --- a/lib/fog/compute/google/models/region.rb +++ b/lib/fog/google/compute/models/region.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Region resource # diff --git a/lib/fog/compute/google/models/regions.rb b/lib/fog/google/compute/models/regions.rb similarity index 85% rename from lib/fog/compute/google/models/regions.rb rename to lib/fog/google/compute/models/regions.rb index 1f8613e78f..4a102b5931 100755 --- a/lib/fog/compute/google/models/regions.rb +++ b/lib/fog/google/compute/models/regions.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Regions < Fog::Collection - model Fog::Compute::Google::Region + model Fog::Google::Compute::Region def all data = service.list_regions.to_h diff --git a/lib/fog/compute/google/models/route.rb b/lib/fog/google/compute/models/route.rb similarity index 90% rename from lib/fog/compute/google/models/route.rb rename to lib/fog/google/compute/models/route.rb index 2e387192ad..a15d17a12c 100644 --- a/lib/fog/compute/google/models/route.rb +++ b/lib/fog/google/compute/models/route.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Route resource # @@ -28,7 +28,7 @@ def save requires :identity, :network, :dest_range, :priority data = service.insert_route(identity, network, dest_range, priority, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -38,7 +38,7 @@ def destroy(async = true) requires :identity data = service.delete_route(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/routes.rb b/lib/fog/google/compute/models/routes.rb similarity index 85% rename from lib/fog/compute/google/models/routes.rb rename to lib/fog/google/compute/models/routes.rb index 2b6c35e4ea..acce0bf2e2 100644 --- a/lib/fog/compute/google/models/routes.rb +++ b/lib/fog/google/compute/models/routes.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Routes < Fog::Collection - model Fog::Compute::Google::Route + model Fog::Google::Compute::Route def all data = service.list_routes.to_h diff --git a/lib/fog/compute/google/models/server.rb b/lib/fog/google/compute/models/server.rb similarity index 95% rename from lib/fog/compute/google/models/server.rb rename to lib/fog/google/compute/models/server.rb index cc85b8a6d1..5fde8e8cbf 100644 --- a/lib/fog/compute/google/models/server.rb +++ b/lib/fog/google/compute/models/server.rb @@ -1,8 +1,8 @@ require "fog/compute/models/server" module Fog - module Compute - class Google + module Google + class Compute class Server < Fog::Compute::Server identity :name @@ -195,12 +195,12 @@ def image_name # Destroy a server. # # @param async [TrueClass] execute the command asynchronously - # @return [Fog::Compute::Google::Operation] + # @return [Fog::Google::Compute::Operation] def destroy(async = true) requires :name, :zone data = service.delete_server(name, zone_name) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -277,7 +277,7 @@ def attach_disk(disk, async = true, options = {}) end data = service.attach_disk(identity, zone_name, disk_obj) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -288,12 +288,12 @@ def attach_disk(disk, async = true, options = {}) # # @param device_name [Object] # @param async [TrueClass] - # @returns [Fog::Compute::Google::Server] server object + # @returns [Fog::Google::Compute::Server] server object def detach_disk(device_name, async = true) requires :identity, :zone data = service.detach_disk(identity, zone, device_name) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -315,7 +315,7 @@ def reboot(async = true) requires :identity, :zone data = service.reset_server(identity, zone_name) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -326,7 +326,7 @@ def start(async = true) requires :identity, :zone data = service.start_server(identity, zone_name) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -337,7 +337,7 @@ def stop(async = true) requires :identity, :zone data = service.stop_server(identity, zone_name) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -362,7 +362,7 @@ def set_disk_auto_delete(auto_delete, device_name = nil, async = true) identity, zone_name, auto_delete, device_name ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -381,7 +381,7 @@ def set_scheduling(async = true, :preemptible => preemptible ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -394,7 +394,7 @@ def set_scheduling(async = true, # @param [Hash] new_metadata A new metadata object # Format: {'foo' => 'bar', 'baz'=>'foo'} # - # @returns [Fog::Compute::Google::Server] server object + # @returns [Fog::Google::Compute::Server] server object def set_metadata(new_metadata = {}, async = true) requires :identity, :zone @@ -408,7 +408,7 @@ def set_metadata(new_metadata = {}, async = true) data = service.set_server_metadata( identity, zone_name, metadata[:fingerprint], new_metadata_items ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -421,7 +421,7 @@ def set_tags(new_tags = [], async = true) data = service.set_server_tags( identity, zone_name, tags[:fingerprint], new_tags ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -469,7 +469,7 @@ def add_ssh_key(username, key, async = true) identity, zone_name, metadata[:fingerprint], metadata[:items] ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async @@ -538,7 +538,7 @@ def save(username: nil, public_key: nil) data = service.insert_server(name, zone_name, options) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } diff --git a/lib/fog/compute/google/models/servers.rb b/lib/fog/google/compute/models/servers.rb similarity index 97% rename from lib/fog/compute/google/models/servers.rb rename to lib/fog/google/compute/models/servers.rb index 81d5b7da35..5d4946139c 100644 --- a/lib/fog/compute/google/models/servers.rb +++ b/lib/fog/google/compute/models/servers.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Servers < Fog::Collection - model Fog::Compute::Google::Server + model Fog::Google::Compute::Server def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/snapshot.rb b/lib/fog/google/compute/models/snapshot.rb similarity index 94% rename from lib/fog/compute/google/models/snapshot.rb rename to lib/fog/google/compute/models/snapshot.rb index 95fed83062..a47239d041 100644 --- a/lib/fog/compute/google/models/snapshot.rb +++ b/lib/fog/google/compute/models/snapshot.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Snapshot < Fog::Model identity :name @@ -31,7 +31,7 @@ def destroy(async = true) requires :identity data = service.delete_snapshot(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/snapshots.rb b/lib/fog/google/compute/models/snapshots.rb similarity index 90% rename from lib/fog/compute/google/models/snapshots.rb rename to lib/fog/google/compute/models/snapshots.rb index 35bab9e809..b6df63f2da 100644 --- a/lib/fog/compute/google/models/snapshots.rb +++ b/lib/fog/google/compute/models/snapshots.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Snapshots < Fog::Collection - model Fog::Compute::Google::Snapshot + model Fog::Google::Compute::Snapshot def all items = [] diff --git a/lib/fog/compute/google/models/ssl_certificate.rb b/lib/fog/google/compute/models/ssl_certificate.rb similarity index 88% rename from lib/fog/compute/google/models/ssl_certificate.rb rename to lib/fog/google/compute/models/ssl_certificate.rb index ec626149e7..66b87ff412 100644 --- a/lib/fog/compute/google/models/ssl_certificate.rb +++ b/lib/fog/google/compute/models/ssl_certificate.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a SslCertificate resource # @@ -22,7 +22,7 @@ def save identity, certificate, private_key, :description => description ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -31,7 +31,7 @@ def save def destroy(async = true) requires :identity data = service.delete_ssl_certificate(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/ssl_certificates.rb b/lib/fog/google/compute/models/ssl_certificates.rb similarity index 85% rename from lib/fog/compute/google/models/ssl_certificates.rb rename to lib/fog/google/compute/models/ssl_certificates.rb index 97c51f056c..a45947aee6 100644 --- a/lib/fog/compute/google/models/ssl_certificates.rb +++ b/lib/fog/google/compute/models/ssl_certificates.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class SslCertificates < Fog::Collection - model Fog::Compute::Google::SslCertificate + model Fog::Google::Compute::SslCertificate def get(identity) if identity diff --git a/lib/fog/compute/google/models/subnetwork.rb b/lib/fog/google/compute/models/subnetwork.rb similarity index 89% rename from lib/fog/compute/google/models/subnetwork.rb rename to lib/fog/google/compute/models/subnetwork.rb index 2730961c2b..34c0d7851d 100755 --- a/lib/fog/compute/google/models/subnetwork.rb +++ b/lib/fog/google/compute/models/subnetwork.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents a Subnetwork resource # @@ -24,7 +24,7 @@ def save requires :identity, :network, :region, :ip_cidr_range data = service.insert_subnetwork(identity, region, network, ip_cidr_range, attributes) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } reload @@ -34,7 +34,7 @@ def destroy(async = true) requires :identity, :region data = service.delete_subnetwork(identity, region) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async operation @@ -51,7 +51,7 @@ def expand_ip_cidr_range(range, async = true) data = service.expand_subnetwork_ip_cidr_range( identity, region, range ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async reload @@ -63,7 +63,7 @@ def set_private_ip_google_access(access, async = true) data = service.set_subnetwork_private_ip_google_access( identity, region, access ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async diff --git a/lib/fog/compute/google/models/subnetworks.rb b/lib/fog/google/compute/models/subnetworks.rb similarity index 93% rename from lib/fog/compute/google/models/subnetworks.rb rename to lib/fog/google/compute/models/subnetworks.rb index d0911631be..7902a5d3e7 100644 --- a/lib/fog/compute/google/models/subnetworks.rb +++ b/lib/fog/google/compute/models/subnetworks.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Subnetworks < Fog::Collection - model Fog::Compute::Google::Subnetwork + model Fog::Google::Compute::Subnetwork def all(region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) filters = { diff --git a/lib/fog/compute/google/models/target_http_proxies.rb b/lib/fog/google/compute/models/target_http_proxies.rb similarity index 85% rename from lib/fog/compute/google/models/target_http_proxies.rb rename to lib/fog/google/compute/models/target_http_proxies.rb index e88f9e8813..a41cc36cb6 100644 --- a/lib/fog/compute/google/models/target_http_proxies.rb +++ b/lib/fog/google/compute/models/target_http_proxies.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetHttpProxies < Fog::Collection - model Fog::Compute::Google::TargetHttpProxy + model Fog::Google::Compute::TargetHttpProxy def all(_filters = {}) data = service.list_target_http_proxies.to_h[:items] || [] diff --git a/lib/fog/compute/google/models/target_http_proxy.rb b/lib/fog/google/compute/models/target_http_proxy.rb similarity index 89% rename from lib/fog/compute/google/models/target_http_proxy.rb rename to lib/fog/google/compute/models/target_http_proxy.rb index 84b901634a..ce2a7870a3 100644 --- a/lib/fog/compute/google/models/target_http_proxy.rb +++ b/lib/fog/google/compute/models/target_http_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetHttpProxy < Fog::Model identity :name @@ -16,7 +16,7 @@ def save data = service.insert_target_http_proxy( identity, :description => description, :url_map => url_map ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -26,7 +26,7 @@ def destroy(async = true) requires :identity data = service.delete_target_http_proxy(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation @@ -36,7 +36,7 @@ def set_url_map(url_map, async = true) requires :identity data = service.set_target_http_proxy_url_map(identity, url_map) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async reload diff --git a/lib/fog/compute/google/models/target_https_proxies.rb b/lib/fog/google/compute/models/target_https_proxies.rb similarity index 85% rename from lib/fog/compute/google/models/target_https_proxies.rb rename to lib/fog/google/compute/models/target_https_proxies.rb index 3dda59d6e0..ea03266132 100644 --- a/lib/fog/compute/google/models/target_https_proxies.rb +++ b/lib/fog/google/compute/models/target_https_proxies.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetHttpsProxies < Fog::Collection - model Fog::Compute::Google::TargetHttpsProxy + model Fog::Google::Compute::TargetHttpsProxy def all(_filters = {}) data = service.list_target_https_proxies.to_h[:items] || [] diff --git a/lib/fog/compute/google/models/target_https_proxy.rb b/lib/fog/google/compute/models/target_https_proxy.rb similarity index 89% rename from lib/fog/compute/google/models/target_https_proxy.rb rename to lib/fog/google/compute/models/target_https_proxy.rb index dbb0a0a5b7..35bad55386 100644 --- a/lib/fog/compute/google/models/target_https_proxy.rb +++ b/lib/fog/google/compute/models/target_https_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetHttpsProxy < Fog::Model identity :name @@ -16,7 +16,7 @@ class TargetHttpsProxy < Fog::Model # [cert_one.self_link', cert_two.self_link] # # , where 'cert_one' and 'cert_two' are instances of - # Fog::Compute::Google::SslCertificate + # Fog::Google::Compute::SslCertificate # # @return [Array] attribute :ssl_certificates, :aliases => "sslCertificates" @@ -34,7 +34,7 @@ def save :url_map => url_map, :ssl_certificates => ssl_certificates ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -44,7 +44,7 @@ def destroy(async = true) requires :identity data = service.delete_target_https_proxy(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation @@ -56,7 +56,7 @@ def set_url_map(url_map, async = true) data = service.set_target_https_proxy_url_map( identity, url_map ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async reload @@ -68,7 +68,7 @@ def set_ssl_certificates(ssl_certificates, async = true) data = service.set_target_https_proxy_ssl_certificates( identity, ssl_certificates ) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async reload diff --git a/lib/fog/compute/google/models/target_instance.rb b/lib/fog/google/compute/models/target_instance.rb similarity index 91% rename from lib/fog/compute/google/models/target_instance.rb rename to lib/fog/google/compute/models/target_instance.rb index 6daeb8647d..951dfe6e5c 100644 --- a/lib/fog/compute/google/models/target_instance.rb +++ b/lib/fog/google/compute/models/target_instance.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetInstance < Fog::Model identity :name @@ -24,7 +24,7 @@ def save } data = service.insert_target_instance(identity, zone, options) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } reload @@ -33,7 +33,7 @@ def save def destroy(async = true) requires :name, :zone data = service.delete_target_instance(name, zone) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name, data.zone) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/target_instances.rb b/lib/fog/google/compute/models/target_instances.rb similarity index 94% rename from lib/fog/compute/google/models/target_instances.rb rename to lib/fog/google/compute/models/target_instances.rb index 6713070f1e..ab22bacd32 100644 --- a/lib/fog/compute/google/models/target_instances.rb +++ b/lib/fog/google/compute/models/target_instances.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetInstances < Fog::Collection - model Fog::Compute::Google::TargetInstance + model Fog::Google::Compute::TargetInstance def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) diff --git a/lib/fog/compute/google/models/target_pool.rb b/lib/fog/google/compute/models/target_pool.rb similarity index 93% rename from lib/fog/compute/google/models/target_pool.rb rename to lib/fog/google/compute/models/target_pool.rb index cb6cd5e459..7bf1da35e0 100644 --- a/lib/fog/compute/google/models/target_pool.rb +++ b/lib/fog/google/compute/models/target_pool.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetPool < Fog::Model identity :name @@ -22,7 +22,7 @@ def save data = service.insert_target_pool( name, region, attributes.reject { |_k, v| v.nil? } ) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } @@ -32,7 +32,7 @@ def save def destroy(async = true) requires :identity, :region data = service.delete_target_pool(identity, region) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async @@ -43,7 +43,7 @@ def add_instance(instance, async = true) requires :identity instance = instance.self_link unless instance.class == String data = service.add_target_pool_instances(identity, region, [instance]) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async @@ -56,7 +56,7 @@ def remove_instance(instance, async = true) instance = instance.self_link unless instance.class == String data = service.remove_target_pool_instances(identity, region, [instance]) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) @@ -70,7 +70,7 @@ def add_health_check(health_check, async = true) health_check = health_check.self_link unless health_check.class == String data = service.add_target_pool_health_checks(identity, region, [health_check]) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async @@ -83,7 +83,7 @@ def remove_health_check(health_check, async = true) health_check = health_check.self_link unless health_check.class == String data = service.remove_target_pool_health_checks(identity, region, [health_check]) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => service) .get(data.name, nil, data.region) operation.wait_for { ready? } unless async diff --git a/lib/fog/compute/google/models/target_pools.rb b/lib/fog/google/compute/models/target_pools.rb similarity index 93% rename from lib/fog/compute/google/models/target_pools.rb rename to lib/fog/google/compute/models/target_pools.rb index 4ee132ba3e..d4be1e7c6c 100644 --- a/lib/fog/compute/google/models/target_pools.rb +++ b/lib/fog/google/compute/models/target_pools.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class TargetPools < Fog::Collection - model Fog::Compute::Google::TargetPool + model Fog::Google::Compute::TargetPool def all(region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil) opts = { diff --git a/lib/fog/compute/google/models/url_map.rb b/lib/fog/google/compute/models/url_map.rb similarity index 91% rename from lib/fog/compute/google/models/url_map.rb rename to lib/fog/google/compute/models/url_map.rb index b4a351db59..a71fc9cf9c 100644 --- a/lib/fog/compute/google/models/url_map.rb +++ b/lib/fog/google/compute/models/url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class UrlMap < Fog::Model identity :name @@ -34,7 +34,7 @@ def save else data = service.insert_url_map(identity, options) end - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload @@ -44,7 +44,7 @@ def destroy(async = true) requires :identity data = service.delete_url_map(identity) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation @@ -61,7 +61,7 @@ def add_host_rules(rules_to_add, async = true) rules = (host_rules || []).concat rules_to_add data = service.patch_url_map(identity, :host_rules => rules) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async reload @@ -76,7 +76,7 @@ def add_path_matchers(matchers_to_add, rules_to_add, async = true) :host_rules => rules, :path_matchers => matchers) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async reload @@ -86,7 +86,7 @@ def invalidate_cache(path, host = nil, async = true) requires :identity data = service.invalidate_url_map_cache(identity, path, host) - operation = Fog::Compute::Google::Operations.new(:service => service) + operation = Fog::Google::Compute::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation diff --git a/lib/fog/compute/google/models/url_maps.rb b/lib/fog/google/compute/models/url_maps.rb similarity index 85% rename from lib/fog/compute/google/models/url_maps.rb rename to lib/fog/google/compute/models/url_maps.rb index 6f58fb6cb9..860c518454 100644 --- a/lib/fog/compute/google/models/url_maps.rb +++ b/lib/fog/google/compute/models/url_maps.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class UrlMaps < Fog::Collection - model Fog::Compute::Google::UrlMap + model Fog::Google::Compute::UrlMap def all data = service.list_url_maps.to_h[:items] || [] diff --git a/lib/fog/compute/google/models/zone.rb b/lib/fog/google/compute/models/zone.rb similarity index 93% rename from lib/fog/compute/google/models/zone.rb rename to lib/fog/google/compute/models/zone.rb index e215093231..6585843432 100644 --- a/lib/fog/compute/google/models/zone.rb +++ b/lib/fog/google/compute/models/zone.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Zone < Fog::Model identity :name diff --git a/lib/fog/compute/google/models/zones.rb b/lib/fog/google/compute/models/zones.rb similarity index 85% rename from lib/fog/compute/google/models/zones.rb rename to lib/fog/google/compute/models/zones.rb index 5c128af34f..adebf438d5 100644 --- a/lib/fog/compute/google/models/zones.rb +++ b/lib/fog/google/compute/models/zones.rb @@ -1,8 +1,8 @@ module Fog - module Compute - class Google + module Google + class Compute class Zones < Fog::Collection - model Fog::Compute::Google::Zone + model Fog::Google::Compute::Zone def all data = service.list_zones.to_h[:items] || [] diff --git a/lib/fog/compute/google/real.rb b/lib/fog/google/compute/real.rb similarity index 95% rename from lib/fog/compute/google/real.rb rename to lib/fog/google/compute/real.rb index 040b30f2cd..e4726d9dff 100644 --- a/lib/fog/compute/google/real.rb +++ b/lib/fog/google/compute/real.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Real include Fog::Google::Shared diff --git a/lib/fog/compute/google/requests/abandon_instances.rb b/lib/fog/google/compute/requests/abandon_instances.rb similarity index 96% rename from lib/fog/compute/google/requests/abandon_instances.rb rename to lib/fog/google/compute/requests/abandon_instances.rb index 0122169fc1..27136a8022 100644 --- a/lib/fog/compute/google/requests/abandon_instances.rb +++ b/lib/fog/google/compute/requests/abandon_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def abandon_instances(_instance_group_manager, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/add_backend_service_backends.rb b/lib/fog/google/compute/requests/add_backend_service_backends.rb similarity index 91% rename from lib/fog/compute/google/requests/add_backend_service_backends.rb rename to lib/fog/google/compute/requests/add_backend_service_backends.rb index cbf357fea2..70c406b720 100644 --- a/lib/fog/compute/google/requests/add_backend_service_backends.rb +++ b/lib/fog/google/compute/requests/add_backend_service_backends.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_backend_service_backends(_backend_service, _new_backends) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/add_instance_group_instances.rb b/lib/fog/google/compute/requests/add_instance_group_instances.rb similarity index 96% rename from lib/fog/compute/google/requests/add_instance_group_instances.rb rename to lib/fog/google/compute/requests/add_instance_group_instances.rb index d587e36267..a52508cfd6 100644 --- a/lib/fog/compute/google/requests/add_instance_group_instances.rb +++ b/lib/fog/google/compute/requests/add_instance_group_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_instance_group_instances(_group_name, _zone, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/add_server_access_config.rb b/lib/fog/google/compute/requests/add_server_access_config.rb similarity index 95% rename from lib/fog/compute/google/requests/add_server_access_config.rb rename to lib/fog/google/compute/requests/add_server_access_config.rb index e2024c7b61..56d24fdbb4 100644 --- a/lib/fog/compute/google/requests/add_server_access_config.rb +++ b/lib/fog/google/compute/requests/add_server_access_config.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_server_access_config(_identity, _zone, _nic, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/add_target_pool_health_checks.rb b/lib/fog/google/compute/requests/add_target_pool_health_checks.rb similarity index 95% rename from lib/fog/compute/google/requests/add_target_pool_health_checks.rb rename to lib/fog/google/compute/requests/add_target_pool_health_checks.rb index ad5df7bcc6..1b6a49f1c8 100644 --- a/lib/fog/compute/google/requests/add_target_pool_health_checks.rb +++ b/lib/fog/google/compute/requests/add_target_pool_health_checks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_target_pool_health_checks(_target_pool, _region, _health_checks) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/add_target_pool_instances.rb b/lib/fog/google/compute/requests/add_target_pool_instances.rb similarity index 95% rename from lib/fog/compute/google/requests/add_target_pool_instances.rb rename to lib/fog/google/compute/requests/add_target_pool_instances.rb index f4b191a80b..953442c7c6 100644 --- a/lib/fog/compute/google/requests/add_target_pool_instances.rb +++ b/lib/fog/google/compute/requests/add_target_pool_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_target_pool_instances(_target_pool, _region, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/attach_disk.rb b/lib/fog/google/compute/requests/attach_disk.rb similarity index 92% rename from lib/fog/compute/google/requests/attach_disk.rb rename to lib/fog/google/compute/requests/attach_disk.rb index 1220db58c5..2893472926 100644 --- a/lib/fog/compute/google/requests/attach_disk.rb +++ b/lib/fog/google/compute/requests/attach_disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def attach_disk(_instance, _zone, _disk = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/create_disk_snapshot.rb b/lib/fog/google/compute/requests/create_disk_snapshot.rb similarity index 93% rename from lib/fog/compute/google/requests/create_disk_snapshot.rb rename to lib/fog/google/compute/requests/create_disk_snapshot.rb index 043c9589fa..f4c061fca6 100644 --- a/lib/fog/compute/google/requests/create_disk_snapshot.rb +++ b/lib/fog/google/compute/requests/create_disk_snapshot.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def create_disk_snapshot(_snapshot_name, _disk, _zone, _snapshot = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_address.rb b/lib/fog/google/compute/requests/delete_address.rb similarity index 94% rename from lib/fog/compute/google/requests/delete_address.rb rename to lib/fog/google/compute/requests/delete_address.rb index 636b55871c..05e4dbe8e3 100644 --- a/lib/fog/compute/google/requests/delete_address.rb +++ b/lib/fog/google/compute/requests/delete_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_address(_address_name, _region_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_backend_service.rb b/lib/fog/google/compute/requests/delete_backend_service.rb similarity index 91% rename from lib/fog/compute/google/requests/delete_backend_service.rb rename to lib/fog/google/compute/requests/delete_backend_service.rb index 95ec874755..fc9d6610ab 100644 --- a/lib/fog/compute/google/requests/delete_backend_service.rb +++ b/lib/fog/google/compute/requests/delete_backend_service.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_backend_service(_backend_service_name, _zone_name = nil) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_disk.rb b/lib/fog/google/compute/requests/delete_disk.rb similarity index 94% rename from lib/fog/compute/google/requests/delete_disk.rb rename to lib/fog/google/compute/requests/delete_disk.rb index 3fa3616473..0daae67e90 100644 --- a/lib/fog/compute/google/requests/delete_disk.rb +++ b/lib/fog/google/compute/requests/delete_disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_disk(_disk_name, _zone_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_firewall.rb b/lib/fog/google/compute/requests/delete_firewall.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_firewall.rb rename to lib/fog/google/compute/requests/delete_firewall.rb index 921e05062b..dc68692bd2 100644 --- a/lib/fog/compute/google/requests/delete_firewall.rb +++ b/lib/fog/google/compute/requests/delete_firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_firewall(_firewall_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_forwarding_rule.rb b/lib/fog/google/compute/requests/delete_forwarding_rule.rb similarity index 91% rename from lib/fog/compute/google/requests/delete_forwarding_rule.rb rename to lib/fog/google/compute/requests/delete_forwarding_rule.rb index 713aa58122..b0f55c789c 100644 --- a/lib/fog/compute/google/requests/delete_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/delete_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_forwarding_rule(_rule, _region) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_global_address.rb b/lib/fog/google/compute/requests/delete_global_address.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_global_address.rb rename to lib/fog/google/compute/requests/delete_global_address.rb index 9dc3f4ba63..de270b9f19 100644 --- a/lib/fog/compute/google/requests/delete_global_address.rb +++ b/lib/fog/google/compute/requests/delete_global_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_global_address(_address_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_global_forwarding_rule.rb b/lib/fog/google/compute/requests/delete_global_forwarding_rule.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_global_forwarding_rule.rb rename to lib/fog/google/compute/requests/delete_global_forwarding_rule.rb index 34e399c3ef..32d2a36cd7 100644 --- a/lib/fog/compute/google/requests/delete_global_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/delete_global_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_global_forwarding_rule(_rule) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_global_operation.rb b/lib/fog/google/compute/requests/delete_global_operation.rb similarity index 92% rename from lib/fog/compute/google/requests/delete_global_operation.rb rename to lib/fog/google/compute/requests/delete_global_operation.rb index f680658c42..6bd24f30a3 100644 --- a/lib/fog/compute/google/requests/delete_global_operation.rb +++ b/lib/fog/google/compute/requests/delete_global_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_global_operation(_operation) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_http_health_check.rb b/lib/fog/google/compute/requests/delete_http_health_check.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_http_health_check.rb rename to lib/fog/google/compute/requests/delete_http_health_check.rb index 1ddba27756..66a5ea15fb 100644 --- a/lib/fog/compute/google/requests/delete_http_health_check.rb +++ b/lib/fog/google/compute/requests/delete_http_health_check.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_http_health_check(_check_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_image.rb b/lib/fog/google/compute/requests/delete_image.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_image.rb rename to lib/fog/google/compute/requests/delete_image.rb index 7d2c2ac966..2d0bca4bd6 100644 --- a/lib/fog/compute/google/requests/delete_image.rb +++ b/lib/fog/google/compute/requests/delete_image.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_image(_image_name, _project = @project) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_instance_group.rb b/lib/fog/google/compute/requests/delete_instance_group.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_instance_group.rb rename to lib/fog/google/compute/requests/delete_instance_group.rb index 9d7a3d6ac8..1f7f1ab173 100644 --- a/lib/fog/compute/google/requests/delete_instance_group.rb +++ b/lib/fog/google/compute/requests/delete_instance_group.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_instance_group(_group_name, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_instance_group_manager.rb b/lib/fog/google/compute/requests/delete_instance_group_manager.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_instance_group_manager.rb rename to lib/fog/google/compute/requests/delete_instance_group_manager.rb index a2d1aa4bd8..926760a3c2 100644 --- a/lib/fog/compute/google/requests/delete_instance_group_manager.rb +++ b/lib/fog/google/compute/requests/delete_instance_group_manager.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_instance_group_manager(_name, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_instance_template.rb b/lib/fog/google/compute/requests/delete_instance_template.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_instance_template.rb rename to lib/fog/google/compute/requests/delete_instance_template.rb index 77bdc83a44..c459a16ccf 100644 --- a/lib/fog/compute/google/requests/delete_instance_template.rb +++ b/lib/fog/google/compute/requests/delete_instance_template.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_instance_template(_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_network.rb b/lib/fog/google/compute/requests/delete_network.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_network.rb rename to lib/fog/google/compute/requests/delete_network.rb index 3497fca341..914014a4d9 100644 --- a/lib/fog/compute/google/requests/delete_network.rb +++ b/lib/fog/google/compute/requests/delete_network.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_network(_network_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_region_operation.rb b/lib/fog/google/compute/requests/delete_region_operation.rb similarity index 94% rename from lib/fog/compute/google/requests/delete_region_operation.rb rename to lib/fog/google/compute/requests/delete_region_operation.rb index 09f048de5e..21641cb49c 100644 --- a/lib/fog/compute/google/requests/delete_region_operation.rb +++ b/lib/fog/google/compute/requests/delete_region_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_region_operation(_region, _operation) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_route.rb b/lib/fog/google/compute/requests/delete_route.rb similarity index 93% rename from lib/fog/compute/google/requests/delete_route.rb rename to lib/fog/google/compute/requests/delete_route.rb index 354137ad22..a8a4f27f1d 100644 --- a/lib/fog/compute/google/requests/delete_route.rb +++ b/lib/fog/google/compute/requests/delete_route.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_route(_identity) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_server.rb b/lib/fog/google/compute/requests/delete_server.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_server.rb rename to lib/fog/google/compute/requests/delete_server.rb index d741dc0bdb..b9e351149b 100644 --- a/lib/fog/compute/google/requests/delete_server.rb +++ b/lib/fog/google/compute/requests/delete_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_server(_server, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_server_access_config.rb b/lib/fog/google/compute/requests/delete_server_access_config.rb similarity index 93% rename from lib/fog/compute/google/requests/delete_server_access_config.rb rename to lib/fog/google/compute/requests/delete_server_access_config.rb index 94f154faaf..ac2e26d605 100644 --- a/lib/fog/compute/google/requests/delete_server_access_config.rb +++ b/lib/fog/google/compute/requests/delete_server_access_config.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_server_access_config(_identity, _zone, _nic, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_snapshot.rb b/lib/fog/google/compute/requests/delete_snapshot.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_snapshot.rb rename to lib/fog/google/compute/requests/delete_snapshot.rb index 8b8fe55c03..cb922c5fb8 100644 --- a/lib/fog/compute/google/requests/delete_snapshot.rb +++ b/lib/fog/google/compute/requests/delete_snapshot.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_snapshot(_snapshot_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_ssl_certificate.rb b/lib/fog/google/compute/requests/delete_ssl_certificate.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_ssl_certificate.rb rename to lib/fog/google/compute/requests/delete_ssl_certificate.rb index 7c9ecc3d90..4edb52b1f8 100644 --- a/lib/fog/compute/google/requests/delete_ssl_certificate.rb +++ b/lib/fog/google/compute/requests/delete_ssl_certificate.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_ssl_certificate(_certificate_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_subnetwork.rb b/lib/fog/google/compute/requests/delete_subnetwork.rb similarity index 96% rename from lib/fog/compute/google/requests/delete_subnetwork.rb rename to lib/fog/google/compute/requests/delete_subnetwork.rb index 9b38a7fa94..1917e94fa8 100644 --- a/lib/fog/compute/google/requests/delete_subnetwork.rb +++ b/lib/fog/google/compute/requests/delete_subnetwork.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_subnetwork(_subnetwork_name, _region_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_target_http_proxy.rb b/lib/fog/google/compute/requests/delete_target_http_proxy.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_target_http_proxy.rb rename to lib/fog/google/compute/requests/delete_target_http_proxy.rb index eca33dc6f0..157ff447f7 100644 --- a/lib/fog/compute/google/requests/delete_target_http_proxy.rb +++ b/lib/fog/google/compute/requests/delete_target_http_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_target_http_proxy(_proxy_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_target_https_proxy.rb b/lib/fog/google/compute/requests/delete_target_https_proxy.rb similarity index 90% rename from lib/fog/compute/google/requests/delete_target_https_proxy.rb rename to lib/fog/google/compute/requests/delete_target_https_proxy.rb index da064df6bb..fe2746982e 100644 --- a/lib/fog/compute/google/requests/delete_target_https_proxy.rb +++ b/lib/fog/google/compute/requests/delete_target_https_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_target_https_proxy(_proxy_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_target_instance.rb b/lib/fog/google/compute/requests/delete_target_instance.rb similarity index 91% rename from lib/fog/compute/google/requests/delete_target_instance.rb rename to lib/fog/google/compute/requests/delete_target_instance.rb index 1e8154bbf3..61ce10b237 100644 --- a/lib/fog/compute/google/requests/delete_target_instance.rb +++ b/lib/fog/google/compute/requests/delete_target_instance.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_target_instance(_target_name, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_target_pool.rb b/lib/fog/google/compute/requests/delete_target_pool.rb similarity index 91% rename from lib/fog/compute/google/requests/delete_target_pool.rb rename to lib/fog/google/compute/requests/delete_target_pool.rb index 5c3f6045c9..86be10fb83 100644 --- a/lib/fog/compute/google/requests/delete_target_pool.rb +++ b/lib/fog/google/compute/requests/delete_target_pool.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_target_pool(_target_pool, _region) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_url_map.rb b/lib/fog/google/compute/requests/delete_url_map.rb similarity index 89% rename from lib/fog/compute/google/requests/delete_url_map.rb rename to lib/fog/google/compute/requests/delete_url_map.rb index 44b0409dbc..4fee1fb8b1 100644 --- a/lib/fog/compute/google/requests/delete_url_map.rb +++ b/lib/fog/google/compute/requests/delete_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_url_map(_url_map_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/delete_zone_operation.rb b/lib/fog/google/compute/requests/delete_zone_operation.rb similarity index 93% rename from lib/fog/compute/google/requests/delete_zone_operation.rb rename to lib/fog/google/compute/requests/delete_zone_operation.rb index 23f495ff32..21e321587d 100644 --- a/lib/fog/compute/google/requests/delete_zone_operation.rb +++ b/lib/fog/google/compute/requests/delete_zone_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def delete_zone_operation(_zone, _operation) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/deprecate_image.rb b/lib/fog/google/compute/requests/deprecate_image.rb similarity index 93% rename from lib/fog/compute/google/requests/deprecate_image.rb rename to lib/fog/google/compute/requests/deprecate_image.rb index 4b95bb69a3..77c2b14f91 100644 --- a/lib/fog/compute/google/requests/deprecate_image.rb +++ b/lib/fog/google/compute/requests/deprecate_image.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def deprecate_image(_image_name, _deprecation_status = {}, _project = @project) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/detach_disk.rb b/lib/fog/google/compute/requests/detach_disk.rb similarity index 91% rename from lib/fog/compute/google/requests/detach_disk.rb rename to lib/fog/google/compute/requests/detach_disk.rb index b5ab279073..7dee2d4a9c 100644 --- a/lib/fog/compute/google/requests/detach_disk.rb +++ b/lib/fog/google/compute/requests/detach_disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def detach_disk(_instance, _zone, _device_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb b/lib/fog/google/compute/requests/expand_subnetwork_ip_cidr_range.rb similarity index 97% rename from lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb rename to lib/fog/google/compute/requests/expand_subnetwork_ip_cidr_range.rb index 1528956908..61459521b9 100644 --- a/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb +++ b/lib/fog/google/compute/requests/expand_subnetwork_ip_cidr_range.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def expand_subnetwork_ip_cidr_range(_subnetwork, _region, _ip_cidr_range) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_address.rb b/lib/fog/google/compute/requests/get_address.rb similarity index 94% rename from lib/fog/compute/google/requests/get_address.rb rename to lib/fog/google/compute/requests/get_address.rb index 9262ee936d..8e49940dc4 100644 --- a/lib/fog/compute/google/requests/get_address.rb +++ b/lib/fog/google/compute/requests/get_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_address(_address_name, _region_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_backend_service.rb b/lib/fog/google/compute/requests/get_backend_service.rb similarity index 92% rename from lib/fog/compute/google/requests/get_backend_service.rb rename to lib/fog/google/compute/requests/get_backend_service.rb index 0f0901e50d..3259213657 100644 --- a/lib/fog/compute/google/requests/get_backend_service.rb +++ b/lib/fog/google/compute/requests/get_backend_service.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_backend_service(service_name) backend_service = data[:backend_services][service_name] diff --git a/lib/fog/compute/google/requests/get_backend_service_health.rb b/lib/fog/google/compute/requests/get_backend_service_health.rb similarity index 94% rename from lib/fog/compute/google/requests/get_backend_service_health.rb rename to lib/fog/google/compute/requests/get_backend_service_health.rb index 5441557786..3e88671c9d 100644 --- a/lib/fog/compute/google/requests/get_backend_service_health.rb +++ b/lib/fog/google/compute/requests/get_backend_service_health.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_backend_service_health(_backend_service) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_disk.rb b/lib/fog/google/compute/requests/get_disk.rb similarity index 94% rename from lib/fog/compute/google/requests/get_disk.rb rename to lib/fog/google/compute/requests/get_disk.rb index 6718fa232e..3aa73777b2 100644 --- a/lib/fog/compute/google/requests/get_disk.rb +++ b/lib/fog/google/compute/requests/get_disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_disk(_disk_name, _zone_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_disk_type.rb b/lib/fog/google/compute/requests/get_disk_type.rb similarity index 89% rename from lib/fog/compute/google/requests/get_disk_type.rb rename to lib/fog/google/compute/requests/get_disk_type.rb index 0bb59b5a43..f070b959f5 100644 --- a/lib/fog/compute/google/requests/get_disk_type.rb +++ b/lib/fog/google/compute/requests/get_disk_type.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_disk_type(_disk, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_firewall.rb b/lib/fog/google/compute/requests/get_firewall.rb similarity index 89% rename from lib/fog/compute/google/requests/get_firewall.rb rename to lib/fog/google/compute/requests/get_firewall.rb index 07db1c0568..a72b45acb4 100644 --- a/lib/fog/compute/google/requests/get_firewall.rb +++ b/lib/fog/google/compute/requests/get_firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_firewall(_firewall_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_forwarding_rule.rb b/lib/fog/google/compute/requests/get_forwarding_rule.rb similarity index 92% rename from lib/fog/compute/google/requests/get_forwarding_rule.rb rename to lib/fog/google/compute/requests/get_forwarding_rule.rb index 44507aae6f..64abceb405 100644 --- a/lib/fog/compute/google/requests/get_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/get_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_forwarding_rule(_rule, _region) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_global_address.rb b/lib/fog/google/compute/requests/get_global_address.rb similarity index 89% rename from lib/fog/compute/google/requests/get_global_address.rb rename to lib/fog/google/compute/requests/get_global_address.rb index f1f39d86ff..76e598381f 100644 --- a/lib/fog/compute/google/requests/get_global_address.rb +++ b/lib/fog/google/compute/requests/get_global_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_global_address(_address_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_global_forwarding_rule.rb b/lib/fog/google/compute/requests/get_global_forwarding_rule.rb similarity index 89% rename from lib/fog/compute/google/requests/get_global_forwarding_rule.rb rename to lib/fog/google/compute/requests/get_global_forwarding_rule.rb index 100e21b8b8..c18d23928a 100644 --- a/lib/fog/compute/google/requests/get_global_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/get_global_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_global_forwarding_rule(_rule) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_global_operation.rb b/lib/fog/google/compute/requests/get_global_operation.rb similarity index 94% rename from lib/fog/compute/google/requests/get_global_operation.rb rename to lib/fog/google/compute/requests/get_global_operation.rb index c3279bcc58..42d64e4214 100644 --- a/lib/fog/compute/google/requests/get_global_operation.rb +++ b/lib/fog/google/compute/requests/get_global_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_global_operation(_operation) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_http_health_check.rb b/lib/fog/google/compute/requests/get_http_health_check.rb similarity index 89% rename from lib/fog/compute/google/requests/get_http_health_check.rb rename to lib/fog/google/compute/requests/get_http_health_check.rb index 619edf80b4..236804937e 100644 --- a/lib/fog/compute/google/requests/get_http_health_check.rb +++ b/lib/fog/google/compute/requests/get_http_health_check.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_http_health_check(_check_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_image.rb b/lib/fog/google/compute/requests/get_image.rb similarity index 91% rename from lib/fog/compute/google/requests/get_image.rb rename to lib/fog/google/compute/requests/get_image.rb index 03e6d6ad73..ca325d557e 100644 --- a/lib/fog/compute/google/requests/get_image.rb +++ b/lib/fog/google/compute/requests/get_image.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_image(_image_name, _project = @project) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_image_from_family.rb b/lib/fog/google/compute/requests/get_image_from_family.rb similarity index 95% rename from lib/fog/compute/google/requests/get_image_from_family.rb rename to lib/fog/google/compute/requests/get_image_from_family.rb index d5150a702a..3910ebf326 100644 --- a/lib/fog/compute/google/requests/get_image_from_family.rb +++ b/lib/fog/google/compute/requests/get_image_from_family.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_image_from_family(_family, _project = @project) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_instance_group.rb b/lib/fog/google/compute/requests/get_instance_group.rb similarity index 91% rename from lib/fog/compute/google/requests/get_instance_group.rb rename to lib/fog/google/compute/requests/get_instance_group.rb index 096c866bb8..03a6b54a33 100644 --- a/lib/fog/compute/google/requests/get_instance_group.rb +++ b/lib/fog/google/compute/requests/get_instance_group.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_instance_group(_group_name, _zone, _project = @project) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_instance_group_manager.rb b/lib/fog/google/compute/requests/get_instance_group_manager.rb similarity index 90% rename from lib/fog/compute/google/requests/get_instance_group_manager.rb rename to lib/fog/google/compute/requests/get_instance_group_manager.rb index 4f3610980f..1a3f884ef6 100644 --- a/lib/fog/compute/google/requests/get_instance_group_manager.rb +++ b/lib/fog/google/compute/requests/get_instance_group_manager.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_instance_group_manager(_name, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_instance_template.rb b/lib/fog/google/compute/requests/get_instance_template.rb similarity index 89% rename from lib/fog/compute/google/requests/get_instance_template.rb rename to lib/fog/google/compute/requests/get_instance_template.rb index b0feb056cc..e79bd550f8 100644 --- a/lib/fog/compute/google/requests/get_instance_template.rb +++ b/lib/fog/google/compute/requests/get_instance_template.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_instance_template(_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_machine_type.rb b/lib/fog/google/compute/requests/get_machine_type.rb similarity index 91% rename from lib/fog/compute/google/requests/get_machine_type.rb rename to lib/fog/google/compute/requests/get_machine_type.rb index b39c7ef505..cea2f824a8 100644 --- a/lib/fog/compute/google/requests/get_machine_type.rb +++ b/lib/fog/google/compute/requests/get_machine_type.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_machine_type(_machine_type, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_network.rb b/lib/fog/google/compute/requests/get_network.rb similarity index 89% rename from lib/fog/compute/google/requests/get_network.rb rename to lib/fog/google/compute/requests/get_network.rb index 8d246744b3..3c35256b78 100644 --- a/lib/fog/compute/google/requests/get_network.rb +++ b/lib/fog/google/compute/requests/get_network.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_network(_network_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_project.rb b/lib/fog/google/compute/requests/get_project.rb similarity index 88% rename from lib/fog/compute/google/requests/get_project.rb rename to lib/fog/google/compute/requests/get_project.rb index 1e309cb0c0..12145b4447 100644 --- a/lib/fog/compute/google/requests/get_project.rb +++ b/lib/fog/google/compute/requests/get_project.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_project(_identity) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_region.rb b/lib/fog/google/compute/requests/get_region.rb similarity index 89% rename from lib/fog/compute/google/requests/get_region.rb rename to lib/fog/google/compute/requests/get_region.rb index 41872095e8..14bda60d0f 100755 --- a/lib/fog/compute/google/requests/get_region.rb +++ b/lib/fog/google/compute/requests/get_region.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_region(_identity) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_region_operation.rb b/lib/fog/google/compute/requests/get_region_operation.rb similarity index 94% rename from lib/fog/compute/google/requests/get_region_operation.rb rename to lib/fog/google/compute/requests/get_region_operation.rb index d166261987..0efeaa2cc3 100644 --- a/lib/fog/compute/google/requests/get_region_operation.rb +++ b/lib/fog/google/compute/requests/get_region_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_region_operation(_region, _operation) raise Fog::Errors::MockNotImplemented diff --git a/lib/fog/compute/google/requests/get_route.rb b/lib/fog/google/compute/requests/get_route.rb similarity index 92% rename from lib/fog/compute/google/requests/get_route.rb rename to lib/fog/google/compute/requests/get_route.rb index ecd7f745d4..1dc0a6dd6c 100644 --- a/lib/fog/compute/google/requests/get_route.rb +++ b/lib/fog/google/compute/requests/get_route.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_route(_identity) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_server.rb b/lib/fog/google/compute/requests/get_server.rb similarity index 89% rename from lib/fog/compute/google/requests/get_server.rb rename to lib/fog/google/compute/requests/get_server.rb index f5da622548..249c7ae3db 100644 --- a/lib/fog/compute/google/requests/get_server.rb +++ b/lib/fog/google/compute/requests/get_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_server(_instance, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_server_serial_port_output.rb b/lib/fog/google/compute/requests/get_server_serial_port_output.rb similarity index 97% rename from lib/fog/compute/google/requests/get_server_serial_port_output.rb rename to lib/fog/google/compute/requests/get_server_serial_port_output.rb index ea2f57cf7c..01eb34252a 100644 --- a/lib/fog/compute/google/requests/get_server_serial_port_output.rb +++ b/lib/fog/google/compute/requests/get_server_serial_port_output.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_server_serial_port_output(_identity, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_snapshot.rb b/lib/fog/google/compute/requests/get_snapshot.rb similarity index 91% rename from lib/fog/compute/google/requests/get_snapshot.rb rename to lib/fog/google/compute/requests/get_snapshot.rb index 013d533f07..895cc534ec 100644 --- a/lib/fog/compute/google/requests/get_snapshot.rb +++ b/lib/fog/google/compute/requests/get_snapshot.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_snapshot(_snap_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_ssl_certificate.rb b/lib/fog/google/compute/requests/get_ssl_certificate.rb similarity index 90% rename from lib/fog/compute/google/requests/get_ssl_certificate.rb rename to lib/fog/google/compute/requests/get_ssl_certificate.rb index 4fc926dec0..6ae0b5c5c8 100644 --- a/lib/fog/compute/google/requests/get_ssl_certificate.rb +++ b/lib/fog/google/compute/requests/get_ssl_certificate.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_ssl_certificate(_certificate_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_subnetwork.rb b/lib/fog/google/compute/requests/get_subnetwork.rb similarity index 96% rename from lib/fog/compute/google/requests/get_subnetwork.rb rename to lib/fog/google/compute/requests/get_subnetwork.rb index 3d753d4acc..303f3fcc14 100644 --- a/lib/fog/compute/google/requests/get_subnetwork.rb +++ b/lib/fog/google/compute/requests/get_subnetwork.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_subnetwork(_subnetwork_name, _region_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_target_http_proxy.rb b/lib/fog/google/compute/requests/get_target_http_proxy.rb similarity index 89% rename from lib/fog/compute/google/requests/get_target_http_proxy.rb rename to lib/fog/google/compute/requests/get_target_http_proxy.rb index 121625c528..510b7b6851 100644 --- a/lib/fog/compute/google/requests/get_target_http_proxy.rb +++ b/lib/fog/google/compute/requests/get_target_http_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_target_http_proxy(_proxy_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_target_https_proxy.rb b/lib/fog/google/compute/requests/get_target_https_proxy.rb similarity index 89% rename from lib/fog/compute/google/requests/get_target_https_proxy.rb rename to lib/fog/google/compute/requests/get_target_https_proxy.rb index b6a1d56c71..9f63b0d40c 100644 --- a/lib/fog/compute/google/requests/get_target_https_proxy.rb +++ b/lib/fog/google/compute/requests/get_target_https_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_target_https_proxy(_proxy_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_target_instance.rb b/lib/fog/google/compute/requests/get_target_instance.rb similarity index 91% rename from lib/fog/compute/google/requests/get_target_instance.rb rename to lib/fog/google/compute/requests/get_target_instance.rb index 36212748fe..d425d80bf9 100644 --- a/lib/fog/compute/google/requests/get_target_instance.rb +++ b/lib/fog/google/compute/requests/get_target_instance.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_target_instance(_target_name, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_target_pool.rb b/lib/fog/google/compute/requests/get_target_pool.rb similarity index 91% rename from lib/fog/compute/google/requests/get_target_pool.rb rename to lib/fog/google/compute/requests/get_target_pool.rb index 9105c76530..2b78da1c86 100644 --- a/lib/fog/compute/google/requests/get_target_pool.rb +++ b/lib/fog/google/compute/requests/get_target_pool.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_target_pool(_target_pool, _region) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_target_pool_health.rb b/lib/fog/google/compute/requests/get_target_pool_health.rb similarity index 93% rename from lib/fog/compute/google/requests/get_target_pool_health.rb rename to lib/fog/google/compute/requests/get_target_pool_health.rb index f7f4b3947f..f396f46ae8 100644 --- a/lib/fog/compute/google/requests/get_target_pool_health.rb +++ b/lib/fog/google/compute/requests/get_target_pool_health.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_target_pool_health(_target_pool, _region, _instance) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_url_map.rb b/lib/fog/google/compute/requests/get_url_map.rb similarity index 89% rename from lib/fog/compute/google/requests/get_url_map.rb rename to lib/fog/google/compute/requests/get_url_map.rb index cf0afbfcce..5980007e79 100644 --- a/lib/fog/compute/google/requests/get_url_map.rb +++ b/lib/fog/google/compute/requests/get_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_url_map(_url_map_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_zone.rb b/lib/fog/google/compute/requests/get_zone.rb similarity index 88% rename from lib/fog/compute/google/requests/get_zone.rb rename to lib/fog/google/compute/requests/get_zone.rb index 2a02b4a037..13c70c09bb 100644 --- a/lib/fog/compute/google/requests/get_zone.rb +++ b/lib/fog/google/compute/requests/get_zone.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_zone(_zone_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/get_zone_operation.rb b/lib/fog/google/compute/requests/get_zone_operation.rb similarity index 95% rename from lib/fog/compute/google/requests/get_zone_operation.rb rename to lib/fog/google/compute/requests/get_zone_operation.rb index fb1b38b128..3e7ae936dd 100644 --- a/lib/fog/compute/google/requests/get_zone_operation.rb +++ b/lib/fog/google/compute/requests/get_zone_operation.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def get_zone_operation(_zone_name, _operation) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_address.rb b/lib/fog/google/compute/requests/insert_address.rb similarity index 96% rename from lib/fog/compute/google/requests/insert_address.rb rename to lib/fog/google/compute/requests/insert_address.rb index a961db2836..d419a12b66 100644 --- a/lib/fog/compute/google/requests/insert_address.rb +++ b/lib/fog/google/compute/requests/insert_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_address(_address_name, _region_name, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_backend_service.rb b/lib/fog/google/compute/requests/insert_backend_service.rb similarity index 94% rename from lib/fog/compute/google/requests/insert_backend_service.rb rename to lib/fog/google/compute/requests/insert_backend_service.rb index cd2ea73130..74f14f78e3 100644 --- a/lib/fog/compute/google/requests/insert_backend_service.rb +++ b/lib/fog/google/compute/requests/insert_backend_service.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_backend_service(_backend_service_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_disk.rb b/lib/fog/google/compute/requests/insert_disk.rb similarity index 98% rename from lib/fog/compute/google/requests/insert_disk.rb rename to lib/fog/google/compute/requests/insert_disk.rb index 10160446f6..88e0657afa 100644 --- a/lib/fog/compute/google/requests/insert_disk.rb +++ b/lib/fog/google/compute/requests/insert_disk.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_disk(_disk_name, _zone, _image_name = nil, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_firewall.rb b/lib/fog/google/compute/requests/insert_firewall.rb similarity index 98% rename from lib/fog/compute/google/requests/insert_firewall.rb rename to lib/fog/google/compute/requests/insert_firewall.rb index 8eedf926ab..f69d37c209 100644 --- a/lib/fog/compute/google/requests/insert_firewall.rb +++ b/lib/fog/google/compute/requests/insert_firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_firewall(_firewall_name, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_forwarding_rule.rb b/lib/fog/google/compute/requests/insert_forwarding_rule.rb similarity index 95% rename from lib/fog/compute/google/requests/insert_forwarding_rule.rb rename to lib/fog/google/compute/requests/insert_forwarding_rule.rb index 331ed17df4..8c20985216 100644 --- a/lib/fog/compute/google/requests/insert_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/insert_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_forwarding_rule(_rule_name, _region, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_global_address.rb b/lib/fog/google/compute/requests/insert_global_address.rb similarity index 94% rename from lib/fog/compute/google/requests/insert_global_address.rb rename to lib/fog/google/compute/requests/insert_global_address.rb index 073805f739..0dbb32bf06 100644 --- a/lib/fog/compute/google/requests/insert_global_address.rb +++ b/lib/fog/google/compute/requests/insert_global_address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_global_address(_address_name, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb b/lib/fog/google/compute/requests/insert_global_forwarding_rule.rb similarity index 94% rename from lib/fog/compute/google/requests/insert_global_forwarding_rule.rb rename to lib/fog/google/compute/requests/insert_global_forwarding_rule.rb index f7292b954a..eba5067262 100644 --- a/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb +++ b/lib/fog/google/compute/requests/insert_global_forwarding_rule.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_global_forwarding_rule(_rule_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_http_health_check.rb b/lib/fog/google/compute/requests/insert_http_health_check.rb similarity index 93% rename from lib/fog/compute/google/requests/insert_http_health_check.rb rename to lib/fog/google/compute/requests/insert_http_health_check.rb index 2524d47a0b..741fca4d4f 100644 --- a/lib/fog/compute/google/requests/insert_http_health_check.rb +++ b/lib/fog/google/compute/requests/insert_http_health_check.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_http_health_check(_check_name, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_image.rb b/lib/fog/google/compute/requests/insert_image.rb similarity index 92% rename from lib/fog/compute/google/requests/insert_image.rb rename to lib/fog/google/compute/requests/insert_image.rb index 22cd16582d..202837f895 100644 --- a/lib/fog/compute/google/requests/insert_image.rb +++ b/lib/fog/google/compute/requests/insert_image.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_image(_image_name, _image = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_instance_group.rb b/lib/fog/google/compute/requests/insert_instance_group.rb similarity index 96% rename from lib/fog/compute/google/requests/insert_instance_group.rb rename to lib/fog/google/compute/requests/insert_instance_group.rb index 5f550ca8c9..491166f96d 100644 --- a/lib/fog/compute/google/requests/insert_instance_group.rb +++ b/lib/fog/google/compute/requests/insert_instance_group.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_instance_group(_group_name, _zone, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_instance_group_manager.rb b/lib/fog/google/compute/requests/insert_instance_group_manager.rb similarity index 96% rename from lib/fog/compute/google/requests/insert_instance_group_manager.rb rename to lib/fog/google/compute/requests/insert_instance_group_manager.rb index bfe2a593a9..8428f1a58c 100644 --- a/lib/fog/compute/google/requests/insert_instance_group_manager.rb +++ b/lib/fog/google/compute/requests/insert_instance_group_manager.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_instance_group_manager(_name, _zone, _instance_template, _base_instance_name, _target_size, _target_pools, _named_ports, _description) diff --git a/lib/fog/compute/google/requests/insert_instance_template.rb b/lib/fog/google/compute/requests/insert_instance_template.rb similarity index 97% rename from lib/fog/compute/google/requests/insert_instance_template.rb rename to lib/fog/google/compute/requests/insert_instance_template.rb index 1633a61bbc..be4b5f7b57 100644 --- a/lib/fog/compute/google/requests/insert_instance_template.rb +++ b/lib/fog/google/compute/requests/insert_instance_template.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_instance_template(_name, _properties, _description) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_network.rb b/lib/fog/google/compute/requests/insert_network.rb similarity index 95% rename from lib/fog/compute/google/requests/insert_network.rb rename to lib/fog/google/compute/requests/insert_network.rb index 42f2f94983..5be1fefd3c 100644 --- a/lib/fog/compute/google/requests/insert_network.rb +++ b/lib/fog/google/compute/requests/insert_network.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_network(_network_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_route.rb b/lib/fog/google/compute/requests/insert_route.rb similarity index 96% rename from lib/fog/compute/google/requests/insert_route.rb rename to lib/fog/google/compute/requests/insert_route.rb index 4f6a278077..465c9c3747 100644 --- a/lib/fog/compute/google/requests/insert_route.rb +++ b/lib/fog/google/compute/requests/insert_route.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_route(_route_name, _network, _dest_range, _priority, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_server.rb b/lib/fog/google/compute/requests/insert_server.rb similarity index 97% rename from lib/fog/compute/google/requests/insert_server.rb rename to lib/fog/google/compute/requests/insert_server.rb index 35f99af75e..cddf717e39 100644 --- a/lib/fog/compute/google/requests/insert_server.rb +++ b/lib/fog/google/compute/requests/insert_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_server(_instance_name, _zone, _options = {}) Fog::Mock.not_implemented @@ -40,7 +40,7 @@ def process_network_interfaces(network_interfaces) # This method allows you to use low-level request options and thus # expects instance options similar to API requests. If you don't need to # modify low-level request options, consider using the - # Fog::Compute::Google::Servers collection object instead. + # Fog::Google::Compute::Servers collection object instead. # # @example minimal server creation # my_operation = client.insert_server( diff --git a/lib/fog/compute/google/requests/insert_ssl_certificate.rb b/lib/fog/google/compute/requests/insert_ssl_certificate.rb similarity index 95% rename from lib/fog/compute/google/requests/insert_ssl_certificate.rb rename to lib/fog/google/compute/requests/insert_ssl_certificate.rb index 4fca120b45..3d709d56ee 100644 --- a/lib/fog/compute/google/requests/insert_ssl_certificate.rb +++ b/lib/fog/google/compute/requests/insert_ssl_certificate.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_ssl_certificate(_certificate_name, _certificate, _private_key, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_subnetwork.rb b/lib/fog/google/compute/requests/insert_subnetwork.rb similarity index 98% rename from lib/fog/compute/google/requests/insert_subnetwork.rb rename to lib/fog/google/compute/requests/insert_subnetwork.rb index 889d5a5e74..cbb21ff526 100644 --- a/lib/fog/compute/google/requests/insert_subnetwork.rb +++ b/lib/fog/google/compute/requests/insert_subnetwork.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_subnetwork(_subnetwork_name, _region_name, _network, _ip_range, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_target_http_proxy.rb b/lib/fog/google/compute/requests/insert_target_http_proxy.rb similarity index 94% rename from lib/fog/compute/google/requests/insert_target_http_proxy.rb rename to lib/fog/google/compute/requests/insert_target_http_proxy.rb index 900da0396c..1c6900d8f3 100644 --- a/lib/fog/compute/google/requests/insert_target_http_proxy.rb +++ b/lib/fog/google/compute/requests/insert_target_http_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_target_http_proxy(_proxy_name, _description: nil, _url_map: nil) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_target_https_proxy.rb b/lib/fog/google/compute/requests/insert_target_https_proxy.rb similarity index 95% rename from lib/fog/compute/google/requests/insert_target_https_proxy.rb rename to lib/fog/google/compute/requests/insert_target_https_proxy.rb index 018dc078af..3ae0ff6b61 100644 --- a/lib/fog/compute/google/requests/insert_target_https_proxy.rb +++ b/lib/fog/google/compute/requests/insert_target_https_proxy.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_target_https_proxy(_proxy_name, _description: nil, _url_map: nil, _ssl_certificates: nil) diff --git a/lib/fog/compute/google/requests/insert_target_instance.rb b/lib/fog/google/compute/requests/insert_target_instance.rb similarity index 94% rename from lib/fog/compute/google/requests/insert_target_instance.rb rename to lib/fog/google/compute/requests/insert_target_instance.rb index ec8818f264..7cbc20dfec 100644 --- a/lib/fog/compute/google/requests/insert_target_instance.rb +++ b/lib/fog/google/compute/requests/insert_target_instance.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_target_instance(_target_name, _zone, _target_instance = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_target_pool.rb b/lib/fog/google/compute/requests/insert_target_pool.rb similarity index 93% rename from lib/fog/compute/google/requests/insert_target_pool.rb rename to lib/fog/google/compute/requests/insert_target_pool.rb index 6808c541c9..24278a3cac 100644 --- a/lib/fog/compute/google/requests/insert_target_pool.rb +++ b/lib/fog/google/compute/requests/insert_target_pool.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_target_pool(_target_pool_name, _region, _target_pool = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/insert_url_map.rb b/lib/fog/google/compute/requests/insert_url_map.rb similarity index 96% rename from lib/fog/compute/google/requests/insert_url_map.rb rename to lib/fog/google/compute/requests/insert_url_map.rb index 4dd3e4aa98..dcfe5e9ad3 100644 --- a/lib/fog/compute/google/requests/insert_url_map.rb +++ b/lib/fog/google/compute/requests/insert_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def insert_url_map(_url_map_name, _url_map = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/invalidate_url_map_cache.rb b/lib/fog/google/compute/requests/invalidate_url_map_cache.rb similarity index 93% rename from lib/fog/compute/google/requests/invalidate_url_map_cache.rb rename to lib/fog/google/compute/requests/invalidate_url_map_cache.rb index 16260f5107..a0e196045c 100644 --- a/lib/fog/compute/google/requests/invalidate_url_map_cache.rb +++ b/lib/fog/google/compute/requests/invalidate_url_map_cache.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def invalidate_url_map_cache(_url_map_name, _path, _host = nil) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_addresses.rb b/lib/fog/google/compute/requests/list_addresses.rb similarity index 95% rename from lib/fog/compute/google/requests/list_addresses.rb rename to lib/fog/google/compute/requests/list_addresses.rb index be3d984211..f2d029243d 100644 --- a/lib/fog/compute/google/requests/list_addresses.rb +++ b/lib/fog/google/compute/requests/list_addresses.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_addresses(_region_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_addresses.rb b/lib/fog/google/compute/requests/list_aggregated_addresses.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_addresses.rb rename to lib/fog/google/compute/requests/list_aggregated_addresses.rb index db7a0e7f9f..f96f009853 100644 --- a/lib/fog/compute/google/requests/list_aggregated_addresses.rb +++ b/lib/fog/google/compute/requests/list_aggregated_addresses.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_addresses(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_disk_types.rb b/lib/fog/google/compute/requests/list_aggregated_disk_types.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_disk_types.rb rename to lib/fog/google/compute/requests/list_aggregated_disk_types.rb index 3cc3f1ef2e..03dede9fa9 100644 --- a/lib/fog/compute/google/requests/list_aggregated_disk_types.rb +++ b/lib/fog/google/compute/requests/list_aggregated_disk_types.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_disk_types(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_disks.rb b/lib/fog/google/compute/requests/list_aggregated_disks.rb similarity index 96% rename from lib/fog/compute/google/requests/list_aggregated_disks.rb rename to lib/fog/google/compute/requests/list_aggregated_disks.rb index 9a986a6d04..d6aae67325 100644 --- a/lib/fog/compute/google/requests/list_aggregated_disks.rb +++ b/lib/fog/google/compute/requests/list_aggregated_disks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_disks(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb b/lib/fog/google/compute/requests/list_aggregated_forwarding_rules.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb rename to lib/fog/google/compute/requests/list_aggregated_forwarding_rules.rb index 8346114755..b4143fd7d9 100644 --- a/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb +++ b/lib/fog/google/compute/requests/list_aggregated_forwarding_rules.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_forwarding_rules(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb b/lib/fog/google/compute/requests/list_aggregated_instance_group_managers.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb rename to lib/fog/google/compute/requests/list_aggregated_instance_group_managers.rb index a0063255e1..bb2fcc1d9f 100644 --- a/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb +++ b/lib/fog/google/compute/requests/list_aggregated_instance_group_managers.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_instance_group_managers(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb b/lib/fog/google/compute/requests/list_aggregated_instance_groups.rb similarity index 90% rename from lib/fog/compute/google/requests/list_aggregated_instance_groups.rb rename to lib/fog/google/compute/requests/list_aggregated_instance_groups.rb index bfee3f2f93..f775248ffb 100644 --- a/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +++ b/lib/fog/google/compute/requests/list_aggregated_instance_groups.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_instance_groups(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_machine_types.rb b/lib/fog/google/compute/requests/list_aggregated_machine_types.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_machine_types.rb rename to lib/fog/google/compute/requests/list_aggregated_machine_types.rb index a00fcb0145..d126766f54 100644 --- a/lib/fog/compute/google/requests/list_aggregated_machine_types.rb +++ b/lib/fog/google/compute/requests/list_aggregated_machine_types.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_machine_types(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_servers.rb b/lib/fog/google/compute/requests/list_aggregated_servers.rb similarity index 93% rename from lib/fog/compute/google/requests/list_aggregated_servers.rb rename to lib/fog/google/compute/requests/list_aggregated_servers.rb index d8c4f4d0ff..9102d00f90 100644 --- a/lib/fog/compute/google/requests/list_aggregated_servers.rb +++ b/lib/fog/google/compute/requests/list_aggregated_servers.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_servers(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb b/lib/fog/google/compute/requests/list_aggregated_subnetworks.rb similarity index 97% rename from lib/fog/compute/google/requests/list_aggregated_subnetworks.rb rename to lib/fog/google/compute/requests/list_aggregated_subnetworks.rb index 91e947d531..66f7d5c013 100644 --- a/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb +++ b/lib/fog/google/compute/requests/list_aggregated_subnetworks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_subnetworks(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_target_instances.rb b/lib/fog/google/compute/requests/list_aggregated_target_instances.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_target_instances.rb rename to lib/fog/google/compute/requests/list_aggregated_target_instances.rb index 30eb7f3d64..4b2e13e8b9 100644 --- a/lib/fog/compute/google/requests/list_aggregated_target_instances.rb +++ b/lib/fog/google/compute/requests/list_aggregated_target_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_target_instances(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_aggregated_target_pools.rb b/lib/fog/google/compute/requests/list_aggregated_target_pools.rb similarity index 94% rename from lib/fog/compute/google/requests/list_aggregated_target_pools.rb rename to lib/fog/google/compute/requests/list_aggregated_target_pools.rb index 2123f17990..a65278c539 100644 --- a/lib/fog/compute/google/requests/list_aggregated_target_pools.rb +++ b/lib/fog/google/compute/requests/list_aggregated_target_pools.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_aggregated_target_pools(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_backend_services.rb b/lib/fog/google/compute/requests/list_backend_services.rb similarity index 95% rename from lib/fog/compute/google/requests/list_backend_services.rb rename to lib/fog/google/compute/requests/list_backend_services.rb index 806ca457fd..deabf3eaaf 100644 --- a/lib/fog/compute/google/requests/list_backend_services.rb +++ b/lib/fog/google/compute/requests/list_backend_services.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_backend_services backend_services = data[:backend_services].values diff --git a/lib/fog/compute/google/requests/list_disk_types.rb b/lib/fog/google/compute/requests/list_disk_types.rb similarity index 93% rename from lib/fog/compute/google/requests/list_disk_types.rb rename to lib/fog/google/compute/requests/list_disk_types.rb index 3d5496e689..faf333cfec 100644 --- a/lib/fog/compute/google/requests/list_disk_types.rb +++ b/lib/fog/google/compute/requests/list_disk_types.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_disk_types(_zone, _options: {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_disks.rb b/lib/fog/google/compute/requests/list_disks.rb similarity index 95% rename from lib/fog/compute/google/requests/list_disks.rb rename to lib/fog/google/compute/requests/list_disks.rb index 6bdc0cd7b1..320296f9a4 100644 --- a/lib/fog/compute/google/requests/list_disks.rb +++ b/lib/fog/google/compute/requests/list_disks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_disks(_zone_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_firewalls.rb b/lib/fog/google/compute/requests/list_firewalls.rb similarity index 94% rename from lib/fog/compute/google/requests/list_firewalls.rb rename to lib/fog/google/compute/requests/list_firewalls.rb index 2adad10644..7c34662b1f 100644 --- a/lib/fog/compute/google/requests/list_firewalls.rb +++ b/lib/fog/google/compute/requests/list_firewalls.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_firewalls Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_forwarding_rules.rb b/lib/fog/google/compute/requests/list_forwarding_rules.rb similarity index 94% rename from lib/fog/compute/google/requests/list_forwarding_rules.rb rename to lib/fog/google/compute/requests/list_forwarding_rules.rb index 41c9ea6216..c51ecba2b9 100644 --- a/lib/fog/compute/google/requests/list_forwarding_rules.rb +++ b/lib/fog/google/compute/requests/list_forwarding_rules.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_forwarding_rules(_region, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_global_addresses.rb b/lib/fog/google/compute/requests/list_global_addresses.rb similarity index 95% rename from lib/fog/compute/google/requests/list_global_addresses.rb rename to lib/fog/google/compute/requests/list_global_addresses.rb index 9f05a8b6d4..caeef1c2cb 100644 --- a/lib/fog/compute/google/requests/list_global_addresses.rb +++ b/lib/fog/google/compute/requests/list_global_addresses.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_global_addresses(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_global_forwarding_rules.rb b/lib/fog/google/compute/requests/list_global_forwarding_rules.rb similarity index 94% rename from lib/fog/compute/google/requests/list_global_forwarding_rules.rb rename to lib/fog/google/compute/requests/list_global_forwarding_rules.rb index 599fd3ce16..10a9d44267 100644 --- a/lib/fog/compute/google/requests/list_global_forwarding_rules.rb +++ b/lib/fog/google/compute/requests/list_global_forwarding_rules.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_global_forwarding_rules(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_global_operations.rb b/lib/fog/google/compute/requests/list_global_operations.rb similarity index 94% rename from lib/fog/compute/google/requests/list_global_operations.rb rename to lib/fog/google/compute/requests/list_global_operations.rb index 847c61808f..66c7c3413b 100644 --- a/lib/fog/compute/google/requests/list_global_operations.rb +++ b/lib/fog/google/compute/requests/list_global_operations.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_global_operations Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_http_health_checks.rb b/lib/fog/google/compute/requests/list_http_health_checks.rb similarity index 93% rename from lib/fog/compute/google/requests/list_http_health_checks.rb rename to lib/fog/google/compute/requests/list_http_health_checks.rb index 775e7d29d1..5c6db932af 100644 --- a/lib/fog/compute/google/requests/list_http_health_checks.rb +++ b/lib/fog/google/compute/requests/list_http_health_checks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_http_health_checks Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_images.rb b/lib/fog/google/compute/requests/list_images.rb similarity index 94% rename from lib/fog/compute/google/requests/list_images.rb rename to lib/fog/google/compute/requests/list_images.rb index 7092250dd0..ef031d9940 100644 --- a/lib/fog/compute/google/requests/list_images.rb +++ b/lib/fog/google/compute/requests/list_images.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_images(_project = @project, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_instance_group_instances.rb b/lib/fog/google/compute/requests/list_instance_group_instances.rb similarity index 92% rename from lib/fog/compute/google/requests/list_instance_group_instances.rb rename to lib/fog/google/compute/requests/list_instance_group_instances.rb index 7e114c149f..ef375a50f3 100644 --- a/lib/fog/compute/google/requests/list_instance_group_instances.rb +++ b/lib/fog/google/compute/requests/list_instance_group_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_instance_group_instances(_group, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_instance_group_managers.rb b/lib/fog/google/compute/requests/list_instance_group_managers.rb similarity index 94% rename from lib/fog/compute/google/requests/list_instance_group_managers.rb rename to lib/fog/google/compute/requests/list_instance_group_managers.rb index 6ddc78e108..e058667026 100644 --- a/lib/fog/compute/google/requests/list_instance_group_managers.rb +++ b/lib/fog/google/compute/requests/list_instance_group_managers.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_instance_group_managers(_zone, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_instance_groups.rb b/lib/fog/google/compute/requests/list_instance_groups.rb similarity index 89% rename from lib/fog/compute/google/requests/list_instance_groups.rb rename to lib/fog/google/compute/requests/list_instance_groups.rb index 631b990c2b..5f6be321a1 100644 --- a/lib/fog/compute/google/requests/list_instance_groups.rb +++ b/lib/fog/google/compute/requests/list_instance_groups.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_instance_groups(_zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_instance_templates.rb b/lib/fog/google/compute/requests/list_instance_templates.rb similarity index 94% rename from lib/fog/compute/google/requests/list_instance_templates.rb rename to lib/fog/google/compute/requests/list_instance_templates.rb index b475a00110..30ffdb4c66 100644 --- a/lib/fog/compute/google/requests/list_instance_templates.rb +++ b/lib/fog/google/compute/requests/list_instance_templates.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_instance_templates Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_machine_types.rb b/lib/fog/google/compute/requests/list_machine_types.rb similarity index 95% rename from lib/fog/compute/google/requests/list_machine_types.rb rename to lib/fog/google/compute/requests/list_machine_types.rb index 5ce3ba36fa..5d7af9fc18 100644 --- a/lib/fog/compute/google/requests/list_machine_types.rb +++ b/lib/fog/google/compute/requests/list_machine_types.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_machine_types(_zone, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_networks.rb b/lib/fog/google/compute/requests/list_networks.rb similarity index 94% rename from lib/fog/compute/google/requests/list_networks.rb rename to lib/fog/google/compute/requests/list_networks.rb index 0d02704e26..f4f281b24f 100644 --- a/lib/fog/compute/google/requests/list_networks.rb +++ b/lib/fog/google/compute/requests/list_networks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_networks(_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_region_operations.rb b/lib/fog/google/compute/requests/list_region_operations.rb similarity index 95% rename from lib/fog/compute/google/requests/list_region_operations.rb rename to lib/fog/google/compute/requests/list_region_operations.rb index 6285431217..3d3c664fc5 100644 --- a/lib/fog/compute/google/requests/list_region_operations.rb +++ b/lib/fog/google/compute/requests/list_region_operations.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_region_operations(_region) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_regions.rb b/lib/fog/google/compute/requests/list_regions.rb similarity index 93% rename from lib/fog/compute/google/requests/list_regions.rb rename to lib/fog/google/compute/requests/list_regions.rb index d3ec83119c..2f41b1e62a 100644 --- a/lib/fog/compute/google/requests/list_regions.rb +++ b/lib/fog/google/compute/requests/list_regions.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_regions Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_routes.rb b/lib/fog/google/compute/requests/list_routes.rb similarity index 95% rename from lib/fog/compute/google/requests/list_routes.rb rename to lib/fog/google/compute/requests/list_routes.rb index a4fcf667d7..dd21a4581b 100644 --- a/lib/fog/compute/google/requests/list_routes.rb +++ b/lib/fog/google/compute/requests/list_routes.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_routes(_options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_servers.rb b/lib/fog/google/compute/requests/list_servers.rb similarity index 93% rename from lib/fog/compute/google/requests/list_servers.rb rename to lib/fog/google/compute/requests/list_servers.rb index 1d64cc3913..3f2ac4e415 100644 --- a/lib/fog/compute/google/requests/list_servers.rb +++ b/lib/fog/google/compute/requests/list_servers.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_servers(_zone, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_snapshots.rb b/lib/fog/google/compute/requests/list_snapshots.rb similarity index 93% rename from lib/fog/compute/google/requests/list_snapshots.rb rename to lib/fog/google/compute/requests/list_snapshots.rb index 15c8fe21ce..eca691868f 100644 --- a/lib/fog/compute/google/requests/list_snapshots.rb +++ b/lib/fog/google/compute/requests/list_snapshots.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_snapshots Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_ssl_certificates.rb b/lib/fog/google/compute/requests/list_ssl_certificates.rb similarity index 93% rename from lib/fog/compute/google/requests/list_ssl_certificates.rb rename to lib/fog/google/compute/requests/list_ssl_certificates.rb index 473be11de2..a63efa3d48 100644 --- a/lib/fog/compute/google/requests/list_ssl_certificates.rb +++ b/lib/fog/google/compute/requests/list_ssl_certificates.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_ssl_certificates Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_subnetworks.rb b/lib/fog/google/compute/requests/list_subnetworks.rb similarity index 97% rename from lib/fog/compute/google/requests/list_subnetworks.rb rename to lib/fog/google/compute/requests/list_subnetworks.rb index f678a517a1..47cfa9bbdf 100644 --- a/lib/fog/compute/google/requests/list_subnetworks.rb +++ b/lib/fog/google/compute/requests/list_subnetworks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_subnetworks(_region_name, _filter: nil, _max_results: nil, _order_by: nil, _page_token: nil) diff --git a/lib/fog/compute/google/requests/list_target_http_proxies.rb b/lib/fog/google/compute/requests/list_target_http_proxies.rb similarity index 94% rename from lib/fog/compute/google/requests/list_target_http_proxies.rb rename to lib/fog/google/compute/requests/list_target_http_proxies.rb index a04c0c9cee..c57a045573 100644 --- a/lib/fog/compute/google/requests/list_target_http_proxies.rb +++ b/lib/fog/google/compute/requests/list_target_http_proxies.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_target_http_proxies(_filter: nil, _max_results: nil, _order_by: nil, _page_token: nil) diff --git a/lib/fog/compute/google/requests/list_target_https_proxies.rb b/lib/fog/google/compute/requests/list_target_https_proxies.rb similarity index 93% rename from lib/fog/compute/google/requests/list_target_https_proxies.rb rename to lib/fog/google/compute/requests/list_target_https_proxies.rb index a4bc1a4008..19d4be351c 100644 --- a/lib/fog/compute/google/requests/list_target_https_proxies.rb +++ b/lib/fog/google/compute/requests/list_target_https_proxies.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_target_https_proxies Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_target_instances.rb b/lib/fog/google/compute/requests/list_target_instances.rb similarity index 94% rename from lib/fog/compute/google/requests/list_target_instances.rb rename to lib/fog/google/compute/requests/list_target_instances.rb index a3ee2d2cd2..7e70769a24 100644 --- a/lib/fog/compute/google/requests/list_target_instances.rb +++ b/lib/fog/google/compute/requests/list_target_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_target_instances(_zone, _opts: {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_target_pools.rb b/lib/fog/google/compute/requests/list_target_pools.rb similarity index 94% rename from lib/fog/compute/google/requests/list_target_pools.rb rename to lib/fog/google/compute/requests/list_target_pools.rb index c70b1d1d34..82ae0ec0d3 100644 --- a/lib/fog/compute/google/requests/list_target_pools.rb +++ b/lib/fog/google/compute/requests/list_target_pools.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_target_pools(_region, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_url_maps.rb b/lib/fog/google/compute/requests/list_url_maps.rb similarity index 94% rename from lib/fog/compute/google/requests/list_url_maps.rb rename to lib/fog/google/compute/requests/list_url_maps.rb index ec171093d0..6dc87cb5c6 100644 --- a/lib/fog/compute/google/requests/list_url_maps.rb +++ b/lib/fog/google/compute/requests/list_url_maps.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_url_maps(_filter: nil, _max_results: nil, _order_by: nil, _page_token: nil) diff --git a/lib/fog/compute/google/requests/list_zone_operations.rb b/lib/fog/google/compute/requests/list_zone_operations.rb similarity index 95% rename from lib/fog/compute/google/requests/list_zone_operations.rb rename to lib/fog/google/compute/requests/list_zone_operations.rb index 5128ff1fbd..1981c2160f 100644 --- a/lib/fog/compute/google/requests/list_zone_operations.rb +++ b/lib/fog/google/compute/requests/list_zone_operations.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_zone_operations(_zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/list_zones.rb b/lib/fog/google/compute/requests/list_zones.rb similarity index 93% rename from lib/fog/compute/google/requests/list_zones.rb rename to lib/fog/google/compute/requests/list_zones.rb index 971f7af2ba..31429170eb 100644 --- a/lib/fog/compute/google/requests/list_zones.rb +++ b/lib/fog/google/compute/requests/list_zones.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def list_zones Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/patch_firewall.rb b/lib/fog/google/compute/requests/patch_firewall.rb similarity index 95% rename from lib/fog/compute/google/requests/patch_firewall.rb rename to lib/fog/google/compute/requests/patch_firewall.rb index 14db003d47..8fd59bd9d3 100644 --- a/lib/fog/compute/google/requests/patch_firewall.rb +++ b/lib/fog/google/compute/requests/patch_firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def patch_firewall(_firewall_name, _firewall_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/patch_url_map.rb b/lib/fog/google/compute/requests/patch_url_map.rb similarity index 91% rename from lib/fog/compute/google/requests/patch_url_map.rb rename to lib/fog/google/compute/requests/patch_url_map.rb index 8cd4021634..815a01aaae 100644 --- a/lib/fog/compute/google/requests/patch_url_map.rb +++ b/lib/fog/google/compute/requests/patch_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def patch_url_map(_url_map_name, _options = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/recreate_instances.rb b/lib/fog/google/compute/requests/recreate_instances.rb similarity index 96% rename from lib/fog/compute/google/requests/recreate_instances.rb rename to lib/fog/google/compute/requests/recreate_instances.rb index a6ab146ae3..bbcfc6c986 100644 --- a/lib/fog/compute/google/requests/recreate_instances.rb +++ b/lib/fog/google/compute/requests/recreate_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def recreate_instances(_instance_group_manager, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/remove_instance_group_instances.rb b/lib/fog/google/compute/requests/remove_instance_group_instances.rb similarity index 96% rename from lib/fog/compute/google/requests/remove_instance_group_instances.rb rename to lib/fog/google/compute/requests/remove_instance_group_instances.rb index d51d766bb7..3f1f87ceae 100644 --- a/lib/fog/compute/google/requests/remove_instance_group_instances.rb +++ b/lib/fog/google/compute/requests/remove_instance_group_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def add_instance_group_instances(_group, _zone, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb b/lib/fog/google/compute/requests/remove_target_pool_health_checks.rb similarity index 95% rename from lib/fog/compute/google/requests/remove_target_pool_health_checks.rb rename to lib/fog/google/compute/requests/remove_target_pool_health_checks.rb index 1ab492f61d..48763eb70f 100644 --- a/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb +++ b/lib/fog/google/compute/requests/remove_target_pool_health_checks.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def remove_target_pool_health_checks(_target_pool, _region, _health_checks) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/remove_target_pool_instance.rb b/lib/fog/google/compute/requests/remove_target_pool_instance.rb similarity index 95% rename from lib/fog/compute/google/requests/remove_target_pool_instance.rb rename to lib/fog/google/compute/requests/remove_target_pool_instance.rb index a8f8360cf6..1598049d48 100644 --- a/lib/fog/compute/google/requests/remove_target_pool_instance.rb +++ b/lib/fog/google/compute/requests/remove_target_pool_instance.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def remove_target_pool_instances(_target_pool, _region, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/remove_target_pool_instances.rb b/lib/fog/google/compute/requests/remove_target_pool_instances.rb similarity index 95% rename from lib/fog/compute/google/requests/remove_target_pool_instances.rb rename to lib/fog/google/compute/requests/remove_target_pool_instances.rb index b470017ce8..3975868493 100644 --- a/lib/fog/compute/google/requests/remove_target_pool_instances.rb +++ b/lib/fog/google/compute/requests/remove_target_pool_instances.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def remove_target_pool_instances(_target_pool, _region, _instances) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/reset_server.rb b/lib/fog/google/compute/requests/reset_server.rb similarity index 89% rename from lib/fog/compute/google/requests/reset_server.rb rename to lib/fog/google/compute/requests/reset_server.rb index 3bd973aeeb..7926974627 100644 --- a/lib/fog/compute/google/requests/reset_server.rb +++ b/lib/fog/google/compute/requests/reset_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def reset_server(_identity, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_common_instance_metadata.rb b/lib/fog/google/compute/requests/set_common_instance_metadata.rb similarity index 94% rename from lib/fog/compute/google/requests/set_common_instance_metadata.rb rename to lib/fog/google/compute/requests/set_common_instance_metadata.rb index 9e147a7b9e..c018a0c5e5 100644 --- a/lib/fog/compute/google/requests/set_common_instance_metadata.rb +++ b/lib/fog/google/compute/requests/set_common_instance_metadata.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_common_instance_metadata(_project, _current_fingerprint, _metadata = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_forwarding_rule_target.rb b/lib/fog/google/compute/requests/set_forwarding_rule_target.rb similarity index 93% rename from lib/fog/compute/google/requests/set_forwarding_rule_target.rb rename to lib/fog/google/compute/requests/set_forwarding_rule_target.rb index c56d06105e..d7efd4dc0a 100644 --- a/lib/fog/compute/google/requests/set_forwarding_rule_target.rb +++ b/lib/fog/google/compute/requests/set_forwarding_rule_target.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_forwarding_rule_target(_rule_name, _region, _target_opts) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb b/lib/fog/google/compute/requests/set_global_forwarding_rule_target.rb similarity index 93% rename from lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb rename to lib/fog/google/compute/requests/set_global_forwarding_rule_target.rb index 7ba983438d..e1f494d0c6 100644 --- a/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb +++ b/lib/fog/google/compute/requests/set_global_forwarding_rule_target.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_global_forwarding_rule_target(_rule_name, _target) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_instance_template.rb b/lib/fog/google/compute/requests/set_instance_template.rb similarity index 96% rename from lib/fog/compute/google/requests/set_instance_template.rb rename to lib/fog/google/compute/requests/set_instance_template.rb index 455f92ead7..7e11cacdd1 100644 --- a/lib/fog/compute/google/requests/set_instance_template.rb +++ b/lib/fog/google/compute/requests/set_instance_template.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_instance_template(_instance_group_manager, _instance_template) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_server_disk_auto_delete.rb b/lib/fog/google/compute/requests/set_server_disk_auto_delete.rb similarity index 94% rename from lib/fog/compute/google/requests/set_server_disk_auto_delete.rb rename to lib/fog/google/compute/requests/set_server_disk_auto_delete.rb index 38f84f548f..6dcdadba8f 100644 --- a/lib/fog/compute/google/requests/set_server_disk_auto_delete.rb +++ b/lib/fog/google/compute/requests/set_server_disk_auto_delete.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_server_disk_auto_delete(_identity, _zone, _auto_delete, _device_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_server_metadata.rb b/lib/fog/google/compute/requests/set_server_metadata.rb similarity index 97% rename from lib/fog/compute/google/requests/set_server_metadata.rb rename to lib/fog/google/compute/requests/set_server_metadata.rb index 8817bd3cf1..7d1daeae11 100644 --- a/lib/fog/compute/google/requests/set_server_metadata.rb +++ b/lib/fog/google/compute/requests/set_server_metadata.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_server_metadata(_instance, _zone, _fingerprint, _metadata_items = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_server_scheduling.rb b/lib/fog/google/compute/requests/set_server_scheduling.rb similarity index 95% rename from lib/fog/compute/google/requests/set_server_scheduling.rb rename to lib/fog/google/compute/requests/set_server_scheduling.rb index 3788053915..d9a676610b 100644 --- a/lib/fog/compute/google/requests/set_server_scheduling.rb +++ b/lib/fog/google/compute/requests/set_server_scheduling.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_server_scheduling(_identity, _zone, _on_host_maintenance, _automatic_restart, _preemptible) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_server_tags.rb b/lib/fog/google/compute/requests/set_server_tags.rb similarity index 93% rename from lib/fog/compute/google/requests/set_server_tags.rb rename to lib/fog/google/compute/requests/set_server_tags.rb index ad224066f2..53e1b09269 100644 --- a/lib/fog/compute/google/requests/set_server_tags.rb +++ b/lib/fog/google/compute/requests/set_server_tags.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_server_tags(_instance, _zone, _tags = []) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_snapshot_labels.rb b/lib/fog/google/compute/requests/set_snapshot_labels.rb similarity index 93% rename from lib/fog/compute/google/requests/set_snapshot_labels.rb rename to lib/fog/google/compute/requests/set_snapshot_labels.rb index 8c5104c04b..3849215efb 100644 --- a/lib/fog/compute/google/requests/set_snapshot_labels.rb +++ b/lib/fog/google/compute/requests/set_snapshot_labels.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_snapshot_labels(_snap_name) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb b/lib/fog/google/compute/requests/set_subnetwork_private_ip_google_access.rb similarity index 97% rename from lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb rename to lib/fog/google/compute/requests/set_subnetwork_private_ip_google_access.rb index 9487429bd0..f9eea9be0c 100644 --- a/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb +++ b/lib/fog/google/compute/requests/set_subnetwork_private_ip_google_access.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_subnetwork_private_ip_google_access(_subnetwork_name, _region_name, diff --git a/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb b/lib/fog/google/compute/requests/set_target_http_proxy_url_map.rb similarity index 93% rename from lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb rename to lib/fog/google/compute/requests/set_target_http_proxy_url_map.rb index a037d3468b..b24b6fe4e2 100644 --- a/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb +++ b/lib/fog/google/compute/requests/set_target_http_proxy_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_target_http_proxy_url_map(_proxy_name, _url_map) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb b/lib/fog/google/compute/requests/set_target_https_proxy_ssl_certificates.rb similarity index 94% rename from lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb rename to lib/fog/google/compute/requests/set_target_https_proxy_ssl_certificates.rb index 39b503f471..cececdeb01 100644 --- a/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb +++ b/lib/fog/google/compute/requests/set_target_https_proxy_ssl_certificates.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_target_https_proxy_ssl_certificates(_proxy_name, _certs) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb b/lib/fog/google/compute/requests/set_target_https_proxy_url_map.rb similarity index 93% rename from lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb rename to lib/fog/google/compute/requests/set_target_https_proxy_url_map.rb index a20b75bf81..8d99fd2cf1 100644 --- a/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +++ b/lib/fog/google/compute/requests/set_target_https_proxy_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_target_https_proxy_url_map(_proxy_name, _url_map) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/set_target_pool_backup.rb b/lib/fog/google/compute/requests/set_target_pool_backup.rb similarity index 95% rename from lib/fog/compute/google/requests/set_target_pool_backup.rb rename to lib/fog/google/compute/requests/set_target_pool_backup.rb index 5b848539eb..85d5bbae72 100644 --- a/lib/fog/compute/google/requests/set_target_pool_backup.rb +++ b/lib/fog/google/compute/requests/set_target_pool_backup.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def set_target_pool_backup(_target_pool, _region, _backup_target, _failover_ratio: nil) diff --git a/lib/fog/compute/google/requests/start_server.rb b/lib/fog/google/compute/requests/start_server.rb similarity index 89% rename from lib/fog/compute/google/requests/start_server.rb rename to lib/fog/google/compute/requests/start_server.rb index 8cdf92fdc0..914744686c 100644 --- a/lib/fog/compute/google/requests/start_server.rb +++ b/lib/fog/google/compute/requests/start_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def start_server(_identity, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/stop_server.rb b/lib/fog/google/compute/requests/stop_server.rb similarity index 89% rename from lib/fog/compute/google/requests/stop_server.rb rename to lib/fog/google/compute/requests/stop_server.rb index e9dff9ee9a..81cde6e691 100644 --- a/lib/fog/compute/google/requests/stop_server.rb +++ b/lib/fog/google/compute/requests/stop_server.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def stop_server(_identity, _zone) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/update_firewall.rb b/lib/fog/google/compute/requests/update_firewall.rb similarity index 97% rename from lib/fog/compute/google/requests/update_firewall.rb rename to lib/fog/google/compute/requests/update_firewall.rb index 02d37512a9..8fec43a562 100644 --- a/lib/fog/compute/google/requests/update_firewall.rb +++ b/lib/fog/google/compute/requests/update_firewall.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def update_firewall(_firewall_name, _firewall_opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/update_http_health_check.rb b/lib/fog/google/compute/requests/update_http_health_check.rb similarity index 93% rename from lib/fog/compute/google/requests/update_http_health_check.rb rename to lib/fog/google/compute/requests/update_http_health_check.rb index a261194955..191b07b374 100644 --- a/lib/fog/compute/google/requests/update_http_health_check.rb +++ b/lib/fog/google/compute/requests/update_http_health_check.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def update_http_health_check(_check_name, _opts = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/update_url_map.rb b/lib/fog/google/compute/requests/update_url_map.rb similarity index 94% rename from lib/fog/compute/google/requests/update_url_map.rb rename to lib/fog/google/compute/requests/update_url_map.rb index 10849a5805..677c61208e 100644 --- a/lib/fog/compute/google/requests/update_url_map.rb +++ b/lib/fog/google/compute/requests/update_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def update_url_map(_url_map_name, _url_map = {}) Fog::Mock.not_implemented diff --git a/lib/fog/compute/google/requests/validate_url_map.rb b/lib/fog/google/compute/requests/validate_url_map.rb similarity index 93% rename from lib/fog/compute/google/requests/validate_url_map.rb rename to lib/fog/google/compute/requests/validate_url_map.rb index 5db9eff91f..962d947ae1 100644 --- a/lib/fog/compute/google/requests/validate_url_map.rb +++ b/lib/fog/google/compute/requests/validate_url_map.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock def validate_url_map(_url_map_name, _url_map: {}) Fog::Mock.not_implemented diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index e26d9704a5..87f6fa7550 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -39,7 +39,7 @@ def initialize_google_client(options) # Because of how Google API gem was rewritten, we get to do all sorts # of funky things, like this nonsense. require "google/apis/monitoring_#{Fog::Google::Monitoring::GOOGLE_MONITORING_API_VERSION}" - require "google/apis/compute_#{Fog::Compute::Google::GOOGLE_COMPUTE_API_VERSION}" + require "google/apis/compute_#{Fog::Google::Compute::GOOGLE_COMPUTE_API_VERSION}" require "google/apis/dns_#{Fog::DNS::Google::GOOGLE_DNS_API_VERSION}" require "google/apis/pubsub_#{Fog::Google::Pubsub::GOOGLE_PUBSUB_API_VERSION}" require "google/apis/sqladmin_#{Fog::Google::SQL::GOOGLE_SQL_API_VERSION}" diff --git a/test/helpers/test_collection.rb b/test/helpers/test_collection.rb index 909ab2c8cb..4ea9902cfa 100644 --- a/test/helpers/test_collection.rb +++ b/test/helpers/test_collection.rb @@ -1,6 +1,6 @@ module TestCollection # Anything that includes TestCollection must, during setup, assign @subject and @factory, where - # @subject is the collection under test, (e.g. Fog::Compute[:google].servers) + # @subject is the collection under test, (e.g. Fog::Google::Compute.new.servers) # @factory is a CollectionFactory def test_lifecycle diff --git a/test/integration/compute/core_compute/test_disk_types.rb b/test/integration/compute/core_compute/test_disk_types.rb index fd0ff4b883..d706fe40bc 100644 --- a/test/integration/compute/core_compute/test_disk_types.rb +++ b/test/integration/compute/core_compute/test_disk_types.rb @@ -8,7 +8,7 @@ class TestDiskTypes < FogIntegrationTest southamerica-east1-b us-central1-c us-east1-b us-east4-a us-west1-c).freeze def setup - @subject = Fog::Compute[:google].disk_types + @subject = Fog::Google::Compute.new.disk_types end def test_all diff --git a/test/integration/compute/core_compute/test_disks.rb b/test/integration/compute/core_compute/test_disks.rb index 44ab0d6abe..39d8cadc69 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -5,7 +5,7 @@ class TestDisks < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].disks + @subject = Fog::Google::Compute.new.disks @factory = DisksFactory.new(namespaced_name) end end diff --git a/test/integration/compute/core_compute/test_images.rb b/test/integration/compute/core_compute/test_images.rb index 801a9d1af2..4f5a9c7040 100644 --- a/test/integration/compute/core_compute/test_images.rb +++ b/test/integration/compute/core_compute/test_images.rb @@ -5,7 +5,7 @@ class TestImages < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].images + @subject = Fog::Google::Compute.new.images @factory = ImagesFactory.new(namespaced_name) end diff --git a/test/integration/compute/core_compute/test_machine_types.rb b/test/integration/compute/core_compute/test_machine_types.rb index 1e46460608..1ce26e9020 100644 --- a/test/integration/compute/core_compute/test_machine_types.rb +++ b/test/integration/compute/core_compute/test_machine_types.rb @@ -15,7 +15,7 @@ class TestMachineTypes < FogIntegrationTest us-central1-c us-east1-b us-east4-a us-west1-c).freeze def setup - @subject = Fog::Compute[:google].machine_types + @subject = Fog::Google::Compute.new.machine_types end def test_all diff --git a/test/integration/compute/core_compute/test_operations.rb b/test/integration/compute/core_compute/test_operations.rb index 286823930b..a78a44ffe1 100644 --- a/test/integration/compute/core_compute/test_operations.rb +++ b/test/integration/compute/core_compute/test_operations.rb @@ -2,7 +2,7 @@ class TestOperations < FogIntegrationTest def setup - @subject = Fog::Compute[:google].operations + @subject = Fog::Google::Compute.new.operations end def test_all diff --git a/test/integration/compute/core_compute/test_projects.rb b/test/integration/compute/core_compute/test_projects.rb index e5b244438f..0a03e3ae69 100644 --- a/test/integration/compute/core_compute/test_projects.rb +++ b/test/integration/compute/core_compute/test_projects.rb @@ -2,7 +2,7 @@ class TestProjects < FogIntegrationTest def setup - @subject = Fog::Compute[:google].projects + @subject = Fog::Google::Compute.new.projects end def test_get diff --git a/test/integration/compute/core_compute/test_regions.rb b/test/integration/compute/core_compute/test_regions.rb index 90415beb2d..55e6442528 100644 --- a/test/integration/compute/core_compute/test_regions.rb +++ b/test/integration/compute/core_compute/test_regions.rb @@ -4,7 +4,7 @@ class TestRegions < FogIntegrationTest EXAMPLE_NAMES = %w(asia-east1 asia-northeast1 europe-west1 us-central1 us-east1 us-west1).freeze def setup - @subject = Fog::Compute[:google].regions + @subject = Fog::Google::Compute.new.regions end def test_all diff --git a/test/integration/compute/core_compute/test_servers.rb b/test/integration/compute/core_compute/test_servers.rb index 9a0b1607da..761112a44e 100644 --- a/test/integration/compute/core_compute/test_servers.rb +++ b/test/integration/compute/core_compute/test_servers.rb @@ -8,7 +8,7 @@ class TestServers < FogIntegrationTest # Cleanup is handled by TestCollection def setup - @subject = Fog::Compute[:google].servers + @subject = Fog::Google::Compute.new.servers @factory = ServersFactory.new(namespaced_name) @servers = ServersFactory.new(namespaced_name) @disks = DisksFactory.new(namespaced_name) diff --git a/test/integration/compute/core_compute/test_snapshots.rb b/test/integration/compute/core_compute/test_snapshots.rb index 8418af8e0c..90087b1fdf 100644 --- a/test/integration/compute/core_compute/test_snapshots.rb +++ b/test/integration/compute/core_compute/test_snapshots.rb @@ -4,7 +4,7 @@ class TestComputeSnapshots < FogIntegrationTest def setup - @client = Fog::Compute::Google.new + @client = Fog::Google::Compute.new # Ensure any resources we create with test prefixes are removed Minitest.after_run do delete_test_resources diff --git a/test/integration/compute/core_compute/test_zones.rb b/test/integration/compute/core_compute/test_zones.rb index 2c535d4dc7..ca9cdf2744 100644 --- a/test/integration/compute/core_compute/test_zones.rb +++ b/test/integration/compute/core_compute/test_zones.rb @@ -8,7 +8,7 @@ class TestZones < FogIntegrationTest us-central1-c us-east1-b us-east4-a us-west1-c).freeze def setup - @subject = Fog::Compute[:google].zones + @subject = Fog::Google::Compute.new.zones end def test_all diff --git a/test/integration/compute/core_networking/test_addresses.rb b/test/integration/compute/core_networking/test_addresses.rb index 7e1b33c760..2251970553 100644 --- a/test/integration/compute/core_networking/test_addresses.rb +++ b/test/integration/compute/core_networking/test_addresses.rb @@ -6,7 +6,7 @@ class TestAddresses < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].addresses + @subject = Fog::Google::Compute.new.addresses @servers = ServersFactory.new(namespaced_name) @factory = AddressesFactory.new(namespaced_name) end diff --git a/test/integration/compute/core_networking/test_firewalls.rb b/test/integration/compute/core_networking/test_firewalls.rb index e4badb58a4..2bc7c9710d 100644 --- a/test/integration/compute/core_networking/test_firewalls.rb +++ b/test/integration/compute/core_networking/test_firewalls.rb @@ -5,7 +5,7 @@ class TestFirewalls < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].firewalls + @subject = Fog::Google::Compute.new.firewalls @factory = FirewallsFactory.new(namespaced_name) end end diff --git a/test/integration/compute/core_networking/test_networks.rb b/test/integration/compute/core_networking/test_networks.rb index 75f6aaaa80..c26edc5963 100644 --- a/test/integration/compute/core_networking/test_networks.rb +++ b/test/integration/compute/core_networking/test_networks.rb @@ -6,7 +6,7 @@ class TestNetworks < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].networks + @subject = Fog::Google::Compute.new.networks @servers = ServersFactory.new(namespaced_name) @factory = NetworksFactory.new(namespaced_name) end diff --git a/test/integration/compute/core_networking/test_routes.rb b/test/integration/compute/core_networking/test_routes.rb index 3ad30b14bc..358ce69869 100644 --- a/test/integration/compute/core_networking/test_routes.rb +++ b/test/integration/compute/core_networking/test_routes.rb @@ -2,7 +2,7 @@ class TestRoutes < FogIntegrationTest def setup - @subject = Fog::Compute[:google].routes + @subject = Fog::Google::Compute.new.routes end def test_all diff --git a/test/integration/compute/core_networking/test_subnetworks.rb b/test/integration/compute/core_networking/test_subnetworks.rb index eb72da254f..58f7e3572e 100644 --- a/test/integration/compute/core_networking/test_subnetworks.rb +++ b/test/integration/compute/core_networking/test_subnetworks.rb @@ -5,7 +5,7 @@ class TestSubnetworks < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].subnetworks + @subject = Fog::Google::Compute.new.subnetworks @factory = SubnetworksFactory.new(namespaced_name) end end diff --git a/test/integration/compute/instance_groups/test_instance_group_managers.rb b/test/integration/compute/instance_groups/test_instance_group_managers.rb index 13d811eb5c..3b6c820f91 100644 --- a/test/integration/compute/instance_groups/test_instance_group_managers.rb +++ b/test/integration/compute/instance_groups/test_instance_group_managers.rb @@ -5,7 +5,7 @@ class TestInstanceGroupManagers < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].instance_group_managers + @subject = Fog::Google::Compute.new.instance_group_managers @factory = InstanceGroupManagerFactory.new(namespaced_name) end end diff --git a/test/integration/compute/instance_groups/test_instance_groups.rb b/test/integration/compute/instance_groups/test_instance_groups.rb index dd171f0238..bb010de313 100644 --- a/test/integration/compute/instance_groups/test_instance_groups.rb +++ b/test/integration/compute/instance_groups/test_instance_groups.rb @@ -5,7 +5,7 @@ class TestInstanceGroups < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].instance_groups + @subject = Fog::Google::Compute.new.instance_groups @factory = InstanceGroupsFactory.new(namespaced_name) end end diff --git a/test/integration/compute/instance_groups/test_instance_templates.rb b/test/integration/compute/instance_groups/test_instance_templates.rb index 986dd3374b..9e9ba6d785 100644 --- a/test/integration/compute/instance_groups/test_instance_templates.rb +++ b/test/integration/compute/instance_groups/test_instance_templates.rb @@ -5,7 +5,7 @@ class TestInstanceTemplates < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].instance_templates + @subject = Fog::Google::Compute.new.instance_templates @factory = InstanceTemplateFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_backend_services.rb b/test/integration/compute/loadbalancing/test_backend_services.rb index b167a3a950..795fa8bd43 100644 --- a/test/integration/compute/loadbalancing/test_backend_services.rb +++ b/test/integration/compute/loadbalancing/test_backend_services.rb @@ -5,7 +5,7 @@ class TestBackendServices < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].backend_services + @subject = Fog::Google::Compute.new.backend_services @factory = BackendServicesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_forwarding_rules.rb b/test/integration/compute/loadbalancing/test_forwarding_rules.rb index 0def818796..39cacc79dd 100644 --- a/test/integration/compute/loadbalancing/test_forwarding_rules.rb +++ b/test/integration/compute/loadbalancing/test_forwarding_rules.rb @@ -5,7 +5,7 @@ class TestForwardingRules < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].forwarding_rules + @subject = Fog::Google::Compute.new.forwarding_rules @factory = ForwardingRulesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_global_addresses.rb b/test/integration/compute/loadbalancing/test_global_addresses.rb index b54857caca..4cbb528544 100644 --- a/test/integration/compute/loadbalancing/test_global_addresses.rb +++ b/test/integration/compute/loadbalancing/test_global_addresses.rb @@ -5,7 +5,7 @@ class TestGlobalAddresses < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].global_addresses + @subject = Fog::Google::Compute.new.global_addresses @factory = GlobalAddressesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb b/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb index 5e6ead231b..6686eb0133 100644 --- a/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb +++ b/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb @@ -5,7 +5,7 @@ class TestGlobalForwardingRules < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].global_forwarding_rules + @subject = Fog::Google::Compute.new.global_forwarding_rules @factory = GlobalForwardingRulesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_http_health_checks.rb b/test/integration/compute/loadbalancing/test_http_health_checks.rb index 31cd5a93b9..2b967888d2 100644 --- a/test/integration/compute/loadbalancing/test_http_health_checks.rb +++ b/test/integration/compute/loadbalancing/test_http_health_checks.rb @@ -5,7 +5,7 @@ class TestHttpHealthChecks < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].http_health_checks + @subject = Fog::Google::Compute.new.http_health_checks @factory = HttpHealthChecksFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_ssl_certificates.rb b/test/integration/compute/loadbalancing/test_ssl_certificates.rb index ad3da76fe2..6b8d1fdf80 100644 --- a/test/integration/compute/loadbalancing/test_ssl_certificates.rb +++ b/test/integration/compute/loadbalancing/test_ssl_certificates.rb @@ -5,7 +5,7 @@ class TestSslCertificates < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].ssl_certificates + @subject = Fog::Google::Compute.new.ssl_certificates @factory = SslCertificatesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_target_http_proxies.rb b/test/integration/compute/loadbalancing/test_target_http_proxies.rb index 447308aa27..df94a703a6 100644 --- a/test/integration/compute/loadbalancing/test_target_http_proxies.rb +++ b/test/integration/compute/loadbalancing/test_target_http_proxies.rb @@ -5,7 +5,7 @@ class TestTargetHttpProxies < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].target_http_proxies + @subject = Fog::Google::Compute.new.target_http_proxies @factory = TargetHttpProxiesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_target_https_proxies.rb b/test/integration/compute/loadbalancing/test_target_https_proxies.rb index e3f51944a0..6aadf39bd1 100644 --- a/test/integration/compute/loadbalancing/test_target_https_proxies.rb +++ b/test/integration/compute/loadbalancing/test_target_https_proxies.rb @@ -5,7 +5,7 @@ class TestTargetHttpsProxies < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].target_https_proxies + @subject = Fog::Google::Compute.new.target_https_proxies @factory = TargetHttpsProxiesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_target_instances.rb b/test/integration/compute/loadbalancing/test_target_instances.rb index edf9a94c7c..35dea81908 100644 --- a/test/integration/compute/loadbalancing/test_target_instances.rb +++ b/test/integration/compute/loadbalancing/test_target_instances.rb @@ -5,7 +5,7 @@ class TestTargetInstances < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].target_instances + @subject = Fog::Google::Compute.new.target_instances @factory = TargetInstancesFactory.new(namespaced_name) end end diff --git a/test/integration/compute/loadbalancing/test_target_pools.rb b/test/integration/compute/loadbalancing/test_target_pools.rb index 1a7f0d92e2..8ec6665f7e 100644 --- a/test/integration/compute/loadbalancing/test_target_pools.rb +++ b/test/integration/compute/loadbalancing/test_target_pools.rb @@ -5,9 +5,9 @@ class TestTargetPools < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].target_pools + @subject = Fog::Google::Compute.new.target_pools @factory = TargetPoolsFactory.new(namespaced_name) - @servers = Fog::Compute[:google].servers + @servers = Fog::Google::Compute.new.servers end # Override to include zone in get request diff --git a/test/integration/compute/loadbalancing/test_url_maps.rb b/test/integration/compute/loadbalancing/test_url_maps.rb index 0054f24168..efe5f21a19 100644 --- a/test/integration/compute/loadbalancing/test_url_maps.rb +++ b/test/integration/compute/loadbalancing/test_url_maps.rb @@ -5,7 +5,7 @@ class TestUrlMaps < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].url_maps + @subject = Fog::Google::Compute.new.url_maps @factory = UrlMapsFactory.new(namespaced_name) end end diff --git a/test/integration/factories/addresses_factory.rb b/test/integration/factories/addresses_factory.rb index bc99115119..33c933621f 100644 --- a/test/integration/factories/addresses_factory.rb +++ b/test/integration/factories/addresses_factory.rb @@ -2,7 +2,7 @@ class AddressesFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].addresses, example) + super(Fog::Google::Compute.new.addresses, example) end def get(identity) diff --git a/test/integration/factories/backend_services_factory.rb b/test/integration/factories/backend_services_factory.rb index 84af0c836a..ce06f37f85 100644 --- a/test/integration/factories/backend_services_factory.rb +++ b/test/integration/factories/backend_services_factory.rb @@ -4,7 +4,7 @@ class BackendServicesFactory < CollectionFactory def initialize(example) @http_health_checks = HttpHealthChecksFactory.new(example) - super(Fog::Compute[:google].backend_services, example) + super(Fog::Google::Compute.new.backend_services, example) end def cleanup diff --git a/test/integration/factories/collection_factory.rb b/test/integration/factories/collection_factory.rb index 651fdf4ee5..595d3ada5c 100644 --- a/test/integration/factories/collection_factory.rb +++ b/test/integration/factories/collection_factory.rb @@ -22,7 +22,7 @@ def cleanup(async = false) resources.each { |r| Fog.wait_for { !@subject.all.map(&:identity).include? r.identity } } end - # Creates a collection object instance e.g. Fog::Compute::Google::Server + # Creates a collection object instance e.g. Fog::Google::Compute::Server # # @param custom_params [Hash] override factory creation parameters or provide # additional ones. Useful in tests where you need to create a slightly different diff --git a/test/integration/factories/disks_factory.rb b/test/integration/factories/disks_factory.rb index 16fd276888..2bd361096d 100644 --- a/test/integration/factories/disks_factory.rb +++ b/test/integration/factories/disks_factory.rb @@ -2,7 +2,7 @@ class DisksFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].disks, example) + super(Fog::Google::Compute.new.disks, example) end def get(identity) diff --git a/test/integration/factories/firewalls_factory.rb b/test/integration/factories/firewalls_factory.rb index c197aa7ad6..27eca896f7 100644 --- a/test/integration/factories/firewalls_factory.rb +++ b/test/integration/factories/firewalls_factory.rb @@ -2,7 +2,7 @@ class FirewallsFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].firewalls, example) + super(Fog::Google::Compute.new.firewalls, example) end def params diff --git a/test/integration/factories/forwarding_rules_factory.rb b/test/integration/factories/forwarding_rules_factory.rb index 57351732ec..f8ed914bed 100644 --- a/test/integration/factories/forwarding_rules_factory.rb +++ b/test/integration/factories/forwarding_rules_factory.rb @@ -4,7 +4,7 @@ class ForwardingRulesFactory < CollectionFactory def initialize(example) @target_pools = TargetPoolsFactory.new(example) - super(Fog::Compute[:google].forwarding_rules, example) + super(Fog::Google::Compute.new.forwarding_rules, example) end def cleanup diff --git a/test/integration/factories/global_addresses_factory.rb b/test/integration/factories/global_addresses_factory.rb index a99993a1c4..6fb002460f 100644 --- a/test/integration/factories/global_addresses_factory.rb +++ b/test/integration/factories/global_addresses_factory.rb @@ -2,7 +2,7 @@ class GlobalAddressesFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].global_addresses, example) + super(Fog::Google::Compute.new.global_addresses, example) end def get(identity) diff --git a/test/integration/factories/global_forwarding_rules_factory.rb b/test/integration/factories/global_forwarding_rules_factory.rb index bda180ffa2..a5d631d02a 100644 --- a/test/integration/factories/global_forwarding_rules_factory.rb +++ b/test/integration/factories/global_forwarding_rules_factory.rb @@ -4,7 +4,7 @@ class GlobalForwardingRulesFactory < CollectionFactory def initialize(example) @targets = TargetHttpProxiesFactory.new(example) - super(Fog::Compute[:google].global_forwarding_rules, example) + super(Fog::Google::Compute.new.global_forwarding_rules, example) end def cleanup diff --git a/test/integration/factories/http_health_checks_factory.rb b/test/integration/factories/http_health_checks_factory.rb index 8289685d6e..47f27e6a2f 100644 --- a/test/integration/factories/http_health_checks_factory.rb +++ b/test/integration/factories/http_health_checks_factory.rb @@ -2,7 +2,7 @@ class HttpHealthChecksFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].http_health_checks, example) + super(Fog::Google::Compute.new.http_health_checks, example) end def params diff --git a/test/integration/factories/images_factory.rb b/test/integration/factories/images_factory.rb index 81afb5e6c4..e9aad6cafd 100644 --- a/test/integration/factories/images_factory.rb +++ b/test/integration/factories/images_factory.rb @@ -2,7 +2,7 @@ class ImagesFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].images, example) + super(Fog::Google::Compute.new.images, example) end def get(identity) diff --git a/test/integration/factories/instance_group_manager_factory.rb b/test/integration/factories/instance_group_manager_factory.rb index e9eb5c5493..3f6c27f5ea 100644 --- a/test/integration/factories/instance_group_manager_factory.rb +++ b/test/integration/factories/instance_group_manager_factory.rb @@ -3,7 +3,7 @@ class InstanceGroupManagerFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].instance_group_managers, example) + super(Fog::Google::Compute.new.instance_group_managers, example) @instance_template = InstanceTemplateFactory.new(example) end diff --git a/test/integration/factories/instance_groups_factory.rb b/test/integration/factories/instance_groups_factory.rb index ce0eccc3c0..fd9fb0e7dd 100644 --- a/test/integration/factories/instance_groups_factory.rb +++ b/test/integration/factories/instance_groups_factory.rb @@ -2,7 +2,7 @@ class InstanceGroupsFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].instance_groups, example) + super(Fog::Google::Compute.new.instance_groups, example) end def get(identity) diff --git a/test/integration/factories/instance_template_factory.rb b/test/integration/factories/instance_template_factory.rb index 9a1f0a6ede..4445dad17b 100644 --- a/test/integration/factories/instance_template_factory.rb +++ b/test/integration/factories/instance_template_factory.rb @@ -2,7 +2,7 @@ class InstanceTemplateFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].instance_templates, example) + super(Fog::Google::Compute.new.instance_templates, example) end def params diff --git a/test/integration/factories/networks_factory.rb b/test/integration/factories/networks_factory.rb index fe931f95c6..d0f47a2d06 100644 --- a/test/integration/factories/networks_factory.rb +++ b/test/integration/factories/networks_factory.rb @@ -6,7 +6,7 @@ def initialize(example) # class variable holding a generator, ensuring that the factory gives # us a new network every time it's called @octet_generator = (0..255).each - super(Fog::Compute[:google].networks, example) + super(Fog::Google::Compute.new.networks, example) end def params diff --git a/test/integration/factories/servers_factory.rb b/test/integration/factories/servers_factory.rb index 7ece4cadc4..1342d12d3b 100644 --- a/test/integration/factories/servers_factory.rb +++ b/test/integration/factories/servers_factory.rb @@ -4,7 +4,7 @@ class ServersFactory < CollectionFactory def initialize(example) @disks = DisksFactory.new(example) - super(Fog::Compute[:google].servers, example) + super(Fog::Google::Compute.new.servers, example) end def cleanup diff --git a/test/integration/factories/ssl_certificates_factory.rb b/test/integration/factories/ssl_certificates_factory.rb index 904e8c63cb..b7269b4334 100644 --- a/test/integration/factories/ssl_certificates_factory.rb +++ b/test/integration/factories/ssl_certificates_factory.rb @@ -2,7 +2,7 @@ class SslCertificatesFactory < CollectionFactory def initialize(example) - super(Fog::Compute[:google].ssl_certificates, example) + super(Fog::Google::Compute.new.ssl_certificates, example) end def params diff --git a/test/integration/factories/subnetworks_factory.rb b/test/integration/factories/subnetworks_factory.rb index bec6172f23..a827f563d6 100644 --- a/test/integration/factories/subnetworks_factory.rb +++ b/test/integration/factories/subnetworks_factory.rb @@ -6,7 +6,7 @@ def initialize(example) # class variable holding a generator, ensuring that the factory gives us a # new subnet every time it's called @octet_generator = (0..255).each - super(Fog::Compute[:google].subnetworks, example) + super(Fog::Google::Compute.new.subnetworks, example) end def get(identity) diff --git a/test/integration/factories/target_http_proxies_factory.rb b/test/integration/factories/target_http_proxies_factory.rb index 450922e324..012aa3150d 100644 --- a/test/integration/factories/target_http_proxies_factory.rb +++ b/test/integration/factories/target_http_proxies_factory.rb @@ -4,7 +4,7 @@ class TargetHttpProxiesFactory < CollectionFactory def initialize(example) @url_maps = UrlMapsFactory.new(example) - super(Fog::Compute[:google].target_http_proxies, example) + super(Fog::Google::Compute.new.target_http_proxies, example) end def cleanup diff --git a/test/integration/factories/target_https_proxies_factory.rb b/test/integration/factories/target_https_proxies_factory.rb index 630bd43671..b5c8831b28 100644 --- a/test/integration/factories/target_https_proxies_factory.rb +++ b/test/integration/factories/target_https_proxies_factory.rb @@ -6,7 +6,7 @@ class TargetHttpsProxiesFactory < CollectionFactory def initialize(example) @ssl_certificates = SslCertificatesFactory.new(example) @url_maps = UrlMapsFactory.new(example) - super(Fog::Compute[:google].target_https_proxies, example) + super(Fog::Google::Compute.new.target_https_proxies, example) end def cleanup diff --git a/test/integration/factories/target_instances_factory.rb b/test/integration/factories/target_instances_factory.rb index e9fd9fb66d..3948af826d 100644 --- a/test/integration/factories/target_instances_factory.rb +++ b/test/integration/factories/target_instances_factory.rb @@ -4,7 +4,7 @@ class TargetInstancesFactory < CollectionFactory def initialize(example) @servers = ServersFactory.new(example) - super(Fog::Compute[:google].target_instances, example) + super(Fog::Google::Compute.new.target_instances, example) end def cleanup diff --git a/test/integration/factories/target_pools_factory.rb b/test/integration/factories/target_pools_factory.rb index 610ea4ee28..9a97667f90 100644 --- a/test/integration/factories/target_pools_factory.rb +++ b/test/integration/factories/target_pools_factory.rb @@ -6,7 +6,7 @@ class TargetPoolsFactory < CollectionFactory def initialize(example) @http_health_checks = HttpHealthChecksFactory.new(example) @servers = ServersFactory.new(example) - super(Fog::Compute[:google].target_pools, example) + super(Fog::Google::Compute.new.target_pools, example) end def cleanup diff --git a/test/integration/factories/url_maps_factory.rb b/test/integration/factories/url_maps_factory.rb index 16f49380e1..cbd7f07093 100644 --- a/test/integration/factories/url_maps_factory.rb +++ b/test/integration/factories/url_maps_factory.rb @@ -4,7 +4,7 @@ class UrlMapsFactory < CollectionFactory def initialize(example) @backend_services = BackendServicesFactory.new(example) - super(Fog::Compute[:google].url_maps, example) + super(Fog::Google::Compute.new.url_maps, example) end def cleanup diff --git a/test/integration/test_authentication.rb b/test/integration/test_authentication.rb index 05ab6ad680..3195b552bb 100644 --- a/test/integration/test_authentication.rb +++ b/test/integration/test_authentication.rb @@ -8,35 +8,35 @@ def setup end def test_authenticates_with_json_key_location - c = Fog::Compute::Google.new(:google_key_location => nil, + c = Fog::Google::Compute.new(:google_key_location => nil, :google_key_string => nil, :google_json_key_location => @google_json_key_location, :google_json_key_string => nil) - assert_kind_of(Fog::Compute::Google::Real, c) + assert_kind_of(Fog::Google::Compute::Real, c) end def test_authenticates_with_json_key_string - c = Fog::Compute::Google.new(:google_key_location => nil, + c = Fog::Google::Compute.new(:google_key_location => nil, :google_key_string => nil, :google_json_key_location => nil, :google_json_key_string => @google_json_key_string) - assert_kind_of(Fog::Compute::Google::Real, c) + assert_kind_of(Fog::Google::Compute::Real, c) end def test_raises_argument_error_when_google_project_is_missing - assert_raises(ArgumentError) { Fog::Compute::Google.new(:google_project => nil) } + assert_raises(ArgumentError) { Fog::Google::Compute.new(:google_project => nil) } end def test_raises_argument_error_when_google_client_email_is_missing assert_raises(ArgumentError) do - Fog::Compute::Google.new(:google_client_email => nil, + Fog::Google::Compute.new(:google_client_email => nil, :google_json_key_location => nil) end # JSON key overrides google_client_email end def test_raises_argument_error_when_google_keys_are_given assert_raises(ArgumentError) do - Fog::Compute::Google.new(:google_key_location => nil, + Fog::Google::Compute.new(:google_key_location => nil, :google_key_string => nil, :google_json_key_location => nil, :google_json_key_string => nil) diff --git a/test/unit/compute/test_common_collections.rb b/test/unit/compute/test_common_collections.rb index 972b08ac03..e4d7a10f8c 100644 --- a/test/unit/compute/test_common_collections.rb +++ b/test/unit/compute/test_common_collections.rb @@ -4,13 +4,12 @@ class UnitTestCollections < MiniTest::Test def setup Fog.mock! - @client = Fog::Compute.new(provider: "google", - google_project: "foo") + @client = Fog::Google::Compute.new(google_project: "foo") # Exceptions that do not pass test_common_methods: # # Projects do not have a "list" method in compute API, so 'all' is not implemented - @common_method_exceptions = [Fog::Compute::Google::Projects] + @common_method_exceptions = [Fog::Google::Compute::Projects] # Enumerate all descendants of Fog::Collection descendants = ObjectSpace.each_object(Fog::Collection.singleton_class).to_a diff --git a/test/unit/compute/test_common_models.rb b/test/unit/compute/test_common_models.rb index cce8ab5b7c..0067260c93 100644 --- a/test/unit/compute/test_common_models.rb +++ b/test/unit/compute/test_common_models.rb @@ -3,17 +3,16 @@ class UnitTestModels < MiniTest::Test def setup Fog.mock! - @client = Fog::Compute.new(provider: "google", - google_project: "foo") + @client = Fog::Google::Compute.new(google_project: "foo") # Do not test models that do not have a create method in API - exceptions = [Fog::Compute::Google::MachineType, - Fog::Compute::Google::Region, - Fog::Compute::Google::DiskType, - Fog::Compute::Google::Operation, - Fog::Compute::Google::Zone, - Fog::Compute::Google::Snapshot, - Fog::Compute::Google::Project] + exceptions = [ Fog::Google::Compute::MachineType, + Fog::Google::Compute::Region, + Fog::Google::Compute::DiskType, + Fog::Google::Compute::Operation, + Fog::Google::Compute::Zone, + Fog::Google::Compute::Snapshot, + Fog::Google::Compute::Project ] # Enumerate all descendants of Fog::Model descendants = ObjectSpace.each_object(Fog::Model.singleton_class).to_a @@ -25,7 +24,7 @@ def teardown end def test_common_methods - # This tests whether Fog::Compute::Google models have common lifecycle methods + # This tests whether Fog::Google::Compute models have common lifecycle methods @models.each do |klass| obj = klass.new assert obj.respond_to?(:save), "#{klass} should have a .save method" diff --git a/test/unit/compute/test_server.rb b/test/unit/compute/test_server.rb index 33dc366818..93dc8e0111 100644 --- a/test/unit/compute/test_server.rb +++ b/test/unit/compute/test_server.rb @@ -3,8 +3,7 @@ class UnitTestServer < MiniTest::Test def setup Fog.mock! - @client = Fog::Compute.new(provider: "google", - google_project: "foo") + @client = Fog::Google::Compute.new(google_project: "foo") end def teardown @@ -15,7 +14,7 @@ def test_if_server_accepts_ssh_keys key = "ssh-rsa IAMNOTAREALSSHKEYAMA== user@host.subdomain.example.com" File.stub :read, key do - server = Fog::Compute::Google::Server.new( + server = Fog::Google::Compute::Server.new( :name => "foo", :machine_type => "bar", :disks => ["baz"], @@ -23,7 +22,7 @@ def test_if_server_accepts_ssh_keys :public_key_path => key ) assert_equal(server.public_key, key, - "Fog::Compute::Google::Server loads public_key properly") + "Fog::Google::Compute::Server loads public_key properly") end end end From 4adb1db69245d34e853eaeb5e9bfd912241d7d5f Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 17:48:22 +1000 Subject: [PATCH 03/46] Rename Fog::DNS::Google to Fog::Google::DNS --- examples/dns/project.rb | 4 ++-- examples/dns/zones.rb | 2 +- lib/fog/bin/google.rb | 2 +- lib/fog/google.rb | 7 ++----- lib/fog/{dns/google.rb => google/dns/dns.rb} | 12 +++++------ lib/fog/{dns/google => google/dns}/mock.rb | 4 ++-- .../google => google/dns}/models/change.rb | 4 ++-- .../google => google/dns}/models/changes.rb | 12 +++++------ .../google => google/dns}/models/project.rb | 4 ++-- .../google => google/dns}/models/projects.rb | 8 ++++---- .../google => google/dns}/models/record.rb | 20 +++++++++---------- .../google => google/dns}/models/records.rb | 12 +++++------ .../{dns/google => google/dns}/models/zone.rb | 14 ++++++------- .../google => google/dns}/models/zones.rb | 10 +++++----- lib/fog/{dns/google => google/dns}/real.rb | 4 ++-- .../dns}/requests/create_change.rb | 4 ++-- .../dns}/requests/create_managed_zone.rb | 4 ++-- .../dns}/requests/delete_managed_zone.rb | 4 ++-- .../dns}/requests/get_change.rb | 4 ++-- .../dns}/requests/get_managed_zone.rb | 4 ++-- .../dns}/requests/get_project.rb | 4 ++-- .../dns}/requests/list_changes.rb | 4 ++-- .../dns}/requests/list_managed_zones.rb | 4 ++-- .../requests/list_resource_record_sets.rb | 4 ++-- lib/fog/google/shared.rb | 2 +- 25 files changed, 77 insertions(+), 80 deletions(-) rename lib/fog/{dns/google.rb => google/dns/dns.rb} (82%) rename lib/fog/{dns/google => google/dns}/mock.rb (95%) rename lib/fog/{dns/google => google/dns}/models/change.rb (96%) rename lib/fog/{dns/google => google/dns}/models/changes.rb (80%) rename lib/fog/{dns/google => google/dns}/models/project.rb (98%) rename lib/fog/{dns/google => google/dns}/models/projects.rb (77%) rename lib/fog/{dns/google => google/dns}/models/record.rb (85%) rename lib/fog/{dns/google => google/dns}/models/records.rb (83%) rename lib/fog/{dns/google => google/dns}/models/zone.rb (85%) rename lib/fog/{dns/google => google/dns}/models/zones.rb (78%) rename lib/fog/{dns/google => google/dns}/real.rb (94%) rename lib/fog/{dns/google => google/dns}/requests/create_change.rb (95%) rename lib/fog/{dns/google => google/dns}/requests/create_managed_zone.rb (95%) rename lib/fog/{dns/google => google/dns}/requests/delete_managed_zone.rb (93%) rename lib/fog/{dns/google => google/dns}/requests/get_change.rb (93%) rename lib/fog/{dns/google => google/dns}/requests/get_managed_zone.rb (93%) rename lib/fog/{dns/google => google/dns}/requests/get_project.rb (94%) rename lib/fog/{dns/google => google/dns}/requests/list_changes.rb (95%) rename lib/fog/{dns/google => google/dns}/requests/list_managed_zones.rb (95%) rename lib/fog/{dns/google => google/dns}/requests/list_resource_record_sets.rb (96%) diff --git a/examples/dns/project.rb b/examples/dns/project.rb index 3501911899..18ad0c6c0e 100644 --- a/examples/dns/project.rb +++ b/examples/dns/project.rb @@ -1,7 +1,7 @@ def test - connection = Fog::DNS::Google.new + connection = Fog::Google::DNS.new puts "Get the Project limits..." puts "-------------------------" - connection.projects.get(Fog::DNS[:google].project) + connection.projects.get(Fog::Google::DNS.new.project) end diff --git a/examples/dns/zones.rb b/examples/dns/zones.rb index 13b164f99d..afc5a84b6f 100644 --- a/examples/dns/zones.rb +++ b/examples/dns/zones.rb @@ -1,5 +1,5 @@ def test - connection = Fog::DNS::Google.new + connection = Fog::Google::DNS.new puts "Create a Zone..." puts "----------------" diff --git a/lib/fog/bin/google.rb b/lib/fog/bin/google.rb index d2f9fc64fe..d8c6daeff3 100644 --- a/lib/fog/bin/google.rb +++ b/lib/fog/bin/google.rb @@ -6,7 +6,7 @@ def class_for(key) when :compute Fog::Google::Compute when :dns - Fog::DNS::Google + Fog::Google::DNS when :monitoring Fog::Google::Monitoring when :storage diff --git a/lib/fog/google.rb b/lib/fog/google.rb index e2ea41f530..6743bed536 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -4,12 +4,9 @@ require "fog/google/version" module Fog - module DNS - autoload :Google, File.expand_path("../dns/google", __FILE__) - end - module Google - autoload :Compute, File.expand_path("../google/compute/compute", __FILE__) + autoload :Compute, 'fog/google/compute/compute' + autoload :DNS, 'fog/google/dns/dns' autoload :Mock, File.expand_path("../google/mock", __FILE__) autoload :Monitoring, File.expand_path("../google/monitoring", __FILE__) diff --git a/lib/fog/dns/google.rb b/lib/fog/google/dns/dns.rb similarity index 82% rename from lib/fog/dns/google.rb rename to lib/fog/google/dns/dns.rb index 1407c348a3..db66edd5aa 100644 --- a/lib/fog/dns/google.rb +++ b/lib/fog/google/dns/dns.rb @@ -1,8 +1,8 @@ module Fog - module DNS - class Google < Fog::Service - autoload :Mock, File.expand_path("../google/mock", __FILE__) - autoload :Real, File.expand_path("../google/real", __FILE__) + module Google + class DNS < Fog::Service + autoload :Mock, 'fog/google/dns/mock' + autoload :Real, 'fog/google/dns/real' requires :google_project recognizes( @@ -24,7 +24,7 @@ class Google < Fog::Service ## # MODELS - model_path "fog/dns/google/models" + model_path "fog/google/dns/models" # Zone model :zone @@ -44,7 +44,7 @@ class Google < Fog::Service ## # REQUESTS - request_path "fog/dns/google/requests" + request_path "fog/google/dns/requests" # Zone request :create_managed_zone diff --git a/lib/fog/dns/google/mock.rb b/lib/fog/google/dns/mock.rb similarity index 95% rename from lib/fog/dns/google/mock.rb rename to lib/fog/google/dns/mock.rb index f63a72bd2d..65720d3dec 100644 --- a/lib/fog/dns/google/mock.rb +++ b/lib/fog/google/dns/mock.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS class Mock include Fog::Google::Shared diff --git a/lib/fog/dns/google/models/change.rb b/lib/fog/google/dns/models/change.rb similarity index 96% rename from lib/fog/dns/google/models/change.rb rename to lib/fog/google/dns/models/change.rb index 3f850c9f80..ecc98f8f58 100644 --- a/lib/fog/dns/google/models/change.rb +++ b/lib/fog/google/dns/models/change.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Represents a Change resource # diff --git a/lib/fog/dns/google/models/changes.rb b/lib/fog/google/dns/models/changes.rb similarity index 80% rename from lib/fog/dns/google/models/changes.rb rename to lib/fog/google/dns/models/changes.rb index d7063ee8ad..b0454e6996 100644 --- a/lib/fog/dns/google/models/changes.rb +++ b/lib/fog/google/dns/models/changes.rb @@ -1,15 +1,15 @@ module Fog - module DNS - class Google + module Google + class DNS class Changes < Fog::Collection - model Fog::DNS::Google::Change + model Fog::Google::DNS::Change attribute :zone ## # Enumerates the list of Changes # - # @return [Array] List of Changes resources + # @return [Array] List of Changes resources def all requires :zone @@ -24,7 +24,7 @@ def all # Fetches the representation of an existing Change # # @param [String] identity Change identity - # @return [Fog::DNS::Google::Change] Change resource + # @return [Fog::Google::DNS::Change] Change resource def get(identity) requires :zone if change = service.get_change(zone.identity, identity).to_h @@ -38,7 +38,7 @@ def get(identity) ## # Creates a new instance of a Change # - # @return [Fog::DNS::Google::Change] Change resource + # @return [Fog::Google::DNS::Change] Change resource def new(attributes = {}) requires :zone diff --git a/lib/fog/dns/google/models/project.rb b/lib/fog/google/dns/models/project.rb similarity index 98% rename from lib/fog/dns/google/models/project.rb rename to lib/fog/google/dns/models/project.rb index cbae3deb94..4ccf05b2aa 100644 --- a/lib/fog/dns/google/models/project.rb +++ b/lib/fog/google/dns/models/project.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Represents a Project resource # diff --git a/lib/fog/dns/google/models/projects.rb b/lib/fog/google/dns/models/projects.rb similarity index 77% rename from lib/fog/dns/google/models/projects.rb rename to lib/fog/google/dns/models/projects.rb index 0957158883..04c6c4feb3 100644 --- a/lib/fog/dns/google/models/projects.rb +++ b/lib/fog/google/dns/models/projects.rb @@ -1,14 +1,14 @@ module Fog - module DNS - class Google + module Google + class DNS class Projects < Fog::Collection - model Fog::DNS::Google::Project + model Fog::Google::DNS::Project ## # Fetches the representation of an existing Project # # @param [String] identity Project identity - # @return [Fog::DNS::Google::Project] Project resource + # @return [Fog::Google::DNS::Project] Project resource def get(identity) if project = service.get_project(identity).to_h new(project) diff --git a/lib/fog/dns/google/models/record.rb b/lib/fog/google/dns/models/record.rb similarity index 85% rename from lib/fog/dns/google/models/record.rb rename to lib/fog/google/dns/models/record.rb index c892ac6b92..986ae97d1f 100644 --- a/lib/fog/dns/google/models/record.rb +++ b/lib/fog/google/dns/models/record.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Resource Record Sets resource # @@ -22,7 +22,7 @@ def destroy(async = true) requires :name, :type, :ttl, :rrdatas data = service.create_change(zone.id, [], [resource_record_set_format]) - change = Fog::DNS::Google::Changes + change = Fog::Google::DNS::Changes .new(:service => service, :zone => zone) .get(data.id) change.wait_for { ready? } unless async @@ -33,7 +33,7 @@ def destroy(async = true) # Modifies a previously created Resource Record Sets resource # # @param [Hash] new_attributes Resource Record Set new attributes - # @return [Fog::DNS::Google::Record] Resource Record Sets resource + # @return [Fog::Google::DNS::Record] Resource Record Sets resource def modify(new_attributes) requires :name, :type, :ttl, :rrdatas @@ -41,7 +41,7 @@ def modify(new_attributes) merge_attributes(new_attributes) data = service.create_change(zone.id, [resource_record_set_format], [deletions]) - change = Fog::DNS::Google::Changes + change = Fog::Google::DNS::Changes .new(:service => service, :zone => zone) .get(data.id) new_attributes.key?(:async) ? async = new_attributes[:async] : async = true @@ -52,7 +52,7 @@ def modify(new_attributes) ## # Reloads a Resource Record Sets resource # - # @return [Fog::DNS::Google::Record] Resource Record Sets resource + # @return [Fog::Google::DNS::Record] Resource Record Sets resource def reload requires :name, :type @@ -64,12 +64,12 @@ def reload ## # Creates a new Resource Record Sets resource # - # @return [Fog::DNS::Google::Record] Resource Record Sets resource + # @return [Fog::Google::DNS::Record] Resource Record Sets resource def save requires :name, :type, :ttl, :rrdatas data = service.create_change(zone.id, [resource_record_set_format], []) - change = Fog::DNS::Google::Changes + change = Fog::Google::DNS::Changes .new(:service => service, :zone => zone) .get(data.id) change.wait_for { ready? } @@ -79,7 +79,7 @@ def save ## # Returns the Managed Zone of the Resource Record Sets resource # - # @return [Fog::DNS::Google::Zone] Managed Zone of the Resource Record Sets resource + # @return [Fog::Google::DNS::Zone] Managed Zone of the Resource Record Sets resource attr_reader :zone private @@ -87,7 +87,7 @@ def save ## # Assigns the Managed Zone of the Resource Record Sets resource # - # @param [Fog::DNS::Google::Zone] new_zone Managed Zone of the Resource Record Sets resource + # @param [Fog::Google::DNS::Zone] new_zone Managed Zone of the Resource Record Sets resource attr_writer :zone ## diff --git a/lib/fog/dns/google/models/records.rb b/lib/fog/google/dns/models/records.rb similarity index 83% rename from lib/fog/dns/google/models/records.rb rename to lib/fog/google/dns/models/records.rb index 72d9f5bd3c..d31a9b3eca 100644 --- a/lib/fog/dns/google/models/records.rb +++ b/lib/fog/google/dns/models/records.rb @@ -1,15 +1,15 @@ module Fog - module DNS - class Google + module Google + class DNS class Records < Fog::Collection - model Fog::DNS::Google::Record + model Fog::Google::DNS::Record attribute :zone ## # Enumerates Resource Record Sets that have been created but not yet deleted # - # @return [Array] List of Resource Record Sets resources + # @return [Array] List of Resource Record Sets resources def all requires :zone @@ -26,7 +26,7 @@ def all # # @param [String] name Resource Record Set name # @param [String] type Resource Record Set type - # @return [Fog::DNS::Google::Record] Resource Record Set resource + # @return [Fog::Google::DNS::Record] Resource Record Set resource def get(name, type) requires :zone @@ -41,7 +41,7 @@ def get(name, type) ## # Creates a new instance of a Resource Record Set # - # @return [Fog::DNS::Google::Record] Resource Record Set resource + # @return [Fog::Google::DNS::Record] Resource Record Set resource def new(attributes = {}) requires :zone diff --git a/lib/fog/dns/google/models/zone.rb b/lib/fog/google/dns/models/zone.rb similarity index 85% rename from lib/fog/dns/google/models/zone.rb rename to lib/fog/google/dns/models/zone.rb index 73a4efb528..431823facc 100644 --- a/lib/fog/dns/google/models/zone.rb +++ b/lib/fog/google/dns/models/zone.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Managed Zone resource # @@ -18,10 +18,10 @@ class Zone < Fog::Model ## # Enumerates the list of Changes for the Managed Zone # - # @return Array] List of Changes for the Managed Zone + # @return Array] List of Changes for the Managed Zone def changes @changes = begin - Fog::DNS::Google::Changes.new( + Fog::Google::DNS::Changes.new( :service => service, :zone => self ) @@ -42,10 +42,10 @@ def destroy ## # Enumerates the list of Resource Record Sets for the Managed Zone # - # @return Array] List of Resource Record Sets for the Managed Zone + # @return Array] List of Resource Record Sets for the Managed Zone def records @records = begin - Fog::DNS::Google::Records.new( + Fog::Google::DNS::Records.new( :service => service, :zone => self ) @@ -55,7 +55,7 @@ def records ## # Creates a new Managed Zone # - # @return [Fog::DNS::Google::Zone] Managed Zone + # @return [Fog::Google::DNS::Zone] Managed Zone # @raise [Fog::Errors::Error] If Managed Zone already exists def save requires :name, :domain, :description diff --git a/lib/fog/dns/google/models/zones.rb b/lib/fog/google/dns/models/zones.rb similarity index 78% rename from lib/fog/dns/google/models/zones.rb rename to lib/fog/google/dns/models/zones.rb index 8c6ac09895..eeb959d9c6 100644 --- a/lib/fog/dns/google/models/zones.rb +++ b/lib/fog/google/dns/models/zones.rb @@ -1,13 +1,13 @@ module Fog - module DNS - class Google + module Google + class DNS class Zones < Fog::Collection - model Fog::DNS::Google::Zone + model Fog::Google::DNS::Zone ## # Enumerates Managed Zones that have been created but not yet deleted # - # @return [Array] List of Managed Zone resources + # @return [Array] List of Managed Zone resources def all data = service.list_managed_zones.managed_zones.to_h || [] load(data) @@ -17,7 +17,7 @@ def all # Fetches the representation of an existing Managed Zone # # @param [String] name_or_id Managed Zone name or identity - # @return [Fog::DNS::Google::Zone] Managed Zone resource + # @return [Fog::Google::DNS::Zone] Managed Zone resource def get(name_or_id) if zone = service.get_managed_zone(name_or_id).to_h new(zone) diff --git a/lib/fog/dns/google/real.rb b/lib/fog/google/dns/real.rb similarity index 94% rename from lib/fog/dns/google/real.rb rename to lib/fog/google/dns/real.rb index 8fcdce977c..f4acdfd5cd 100644 --- a/lib/fog/dns/google/real.rb +++ b/lib/fog/google/dns/real.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS class Real include Fog::Google::Shared diff --git a/lib/fog/dns/google/requests/create_change.rb b/lib/fog/google/dns/requests/create_change.rb similarity index 95% rename from lib/fog/dns/google/requests/create_change.rb rename to lib/fog/google/dns/requests/create_change.rb index a5e765b8ac..2ade0a30ee 100644 --- a/lib/fog/dns/google/requests/create_change.rb +++ b/lib/fog/google/dns/requests/create_change.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Atomically updates a ResourceRecordSet collection. # diff --git a/lib/fog/dns/google/requests/create_managed_zone.rb b/lib/fog/google/dns/requests/create_managed_zone.rb similarity index 95% rename from lib/fog/dns/google/requests/create_managed_zone.rb rename to lib/fog/google/dns/requests/create_managed_zone.rb index 7fea62c63a..68b09914d5 100644 --- a/lib/fog/dns/google/requests/create_managed_zone.rb +++ b/lib/fog/google/dns/requests/create_managed_zone.rb @@ -1,7 +1,7 @@ require "date" module Fog - module DNS - class Google + module Google + class DNS ## # Creates a new Managed Zone. # diff --git a/lib/fog/dns/google/requests/delete_managed_zone.rb b/lib/fog/google/dns/requests/delete_managed_zone.rb similarity index 93% rename from lib/fog/dns/google/requests/delete_managed_zone.rb rename to lib/fog/google/dns/requests/delete_managed_zone.rb index fab22adda4..d63819b80a 100644 --- a/lib/fog/dns/google/requests/delete_managed_zone.rb +++ b/lib/fog/google/dns/requests/delete_managed_zone.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Deletes a previously created Managed Zone. # diff --git a/lib/fog/dns/google/requests/get_change.rb b/lib/fog/google/dns/requests/get_change.rb similarity index 93% rename from lib/fog/dns/google/requests/get_change.rb rename to lib/fog/google/dns/requests/get_change.rb index 6b3b95326e..b5edbe6923 100644 --- a/lib/fog/dns/google/requests/get_change.rb +++ b/lib/fog/google/dns/requests/get_change.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Fetches the representation of an existing Change. # diff --git a/lib/fog/dns/google/requests/get_managed_zone.rb b/lib/fog/google/dns/requests/get_managed_zone.rb similarity index 93% rename from lib/fog/dns/google/requests/get_managed_zone.rb rename to lib/fog/google/dns/requests/get_managed_zone.rb index 7486ce502d..23c386ef85 100644 --- a/lib/fog/dns/google/requests/get_managed_zone.rb +++ b/lib/fog/google/dns/requests/get_managed_zone.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Fetches the representation of an existing Managed Zone. # diff --git a/lib/fog/dns/google/requests/get_project.rb b/lib/fog/google/dns/requests/get_project.rb similarity index 94% rename from lib/fog/dns/google/requests/get_project.rb rename to lib/fog/google/dns/requests/get_project.rb index cce1b945b0..42500ff3a8 100644 --- a/lib/fog/dns/google/requests/get_project.rb +++ b/lib/fog/google/dns/requests/get_project.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Fetches the representation of an existing Project. Use this method to look up the limits on the number of # resources that are associated with your project. diff --git a/lib/fog/dns/google/requests/list_changes.rb b/lib/fog/google/dns/requests/list_changes.rb similarity index 95% rename from lib/fog/dns/google/requests/list_changes.rb rename to lib/fog/google/dns/requests/list_changes.rb index 7a0dcae806..ff9b3119f9 100644 --- a/lib/fog/dns/google/requests/list_changes.rb +++ b/lib/fog/google/dns/requests/list_changes.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Enumerates the list of Changes. # diff --git a/lib/fog/dns/google/requests/list_managed_zones.rb b/lib/fog/google/dns/requests/list_managed_zones.rb similarity index 95% rename from lib/fog/dns/google/requests/list_managed_zones.rb rename to lib/fog/google/dns/requests/list_managed_zones.rb index ffaa252389..533e7a36ec 100644 --- a/lib/fog/dns/google/requests/list_managed_zones.rb +++ b/lib/fog/google/dns/requests/list_managed_zones.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Enumerates Managed Zones that have been created but not yet deleted. # diff --git a/lib/fog/dns/google/requests/list_resource_record_sets.rb b/lib/fog/google/dns/requests/list_resource_record_sets.rb similarity index 96% rename from lib/fog/dns/google/requests/list_resource_record_sets.rb rename to lib/fog/google/dns/requests/list_resource_record_sets.rb index b4f513a296..f30afb1a9a 100644 --- a/lib/fog/dns/google/requests/list_resource_record_sets.rb +++ b/lib/fog/google/dns/requests/list_resource_record_sets.rb @@ -1,6 +1,6 @@ module Fog - module DNS - class Google + module Google + class DNS ## # Enumerates Resource Record Sets that have been created but not yet deleted. # diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 87f6fa7550..8780f749b2 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -40,7 +40,7 @@ def initialize_google_client(options) # of funky things, like this nonsense. require "google/apis/monitoring_#{Fog::Google::Monitoring::GOOGLE_MONITORING_API_VERSION}" require "google/apis/compute_#{Fog::Google::Compute::GOOGLE_COMPUTE_API_VERSION}" - require "google/apis/dns_#{Fog::DNS::Google::GOOGLE_DNS_API_VERSION}" + require "google/apis/dns_#{Fog::Google::DNS::GOOGLE_DNS_API_VERSION}" require "google/apis/pubsub_#{Fog::Google::Pubsub::GOOGLE_PUBSUB_API_VERSION}" require "google/apis/sqladmin_#{Fog::Google::SQL::GOOGLE_SQL_API_VERSION}" require "google/apis/storage_#{Fog::Storage::GoogleJSON::GOOGLE_STORAGE_JSON_API_VERSION}" From c4b768c89d669f230279b275be49c57bb90ceaeb Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 18:38:28 +1000 Subject: [PATCH 04/46] Rename Fog::Storage::Google to Fog::Google::Storage --- lib/fog/bin/google.rb | 4 ++-- lib/fog/google.rb | 9 +++------ lib/fog/google/shared.rb | 2 +- .../google.rb => google/storage/storage.rb} | 8 ++++---- .../storage/storage_json.rb} | 14 +++++++------- .../storage/storage_json}/mock.rb | 4 ++-- .../storage/storage_json}/models/directories.rb | 6 +++--- .../storage/storage_json}/models/directory.rb | 6 +++--- .../storage/storage_json}/models/file.rb | 6 +++--- .../storage/storage_json}/models/files.rb | 6 +++--- .../storage/storage_json}/real.rb | 4 ++-- .../storage/storage_json}/requests/copy_object.rb | 4 ++-- .../storage_json}/requests/delete_bucket.rb | 4 ++-- .../storage_json}/requests/delete_object.rb | 4 ++-- .../storage_json}/requests/delete_object_url.rb | 4 ++-- .../storage/storage_json}/requests/get_bucket.rb | 4 ++-- .../storage_json}/requests/get_bucket_acl.rb | 4 ++-- .../storage/storage_json}/requests/get_object.rb | 4 ++-- .../storage_json}/requests/get_object_acl.rb | 4 ++-- .../storage_json}/requests/get_object_http_url.rb | 4 ++-- .../storage_json}/requests/get_object_https_url.rb | 4 ++-- .../storage_json}/requests/get_object_metadata.rb | 4 ++-- .../storage_json}/requests/get_object_url.rb | 8 ++++---- .../storage_json}/requests/list_bucket_acl.rb | 4 ++-- .../storage/storage_json}/requests/list_buckets.rb | 4 ++-- .../storage_json}/requests/list_object_acl.rb | 4 ++-- .../storage/storage_json}/requests/list_objects.rb | 4 ++-- .../storage/storage_json}/requests/put_bucket.rb | 4 ++-- .../storage_json}/requests/put_bucket_acl.rb | 4 ++-- .../storage/storage_json}/requests/put_object.rb | 4 ++-- .../storage_json}/requests/put_object_acl.rb | 4 ++-- .../storage_json}/requests/put_object_url.rb | 4 ++-- .../storage/storage_json}/utils.rb | 6 +++--- .../storage/storage_xml.rb} | 14 +++++++------- .../storage/storage_xml}/mock.rb | 4 ++-- .../storage/storage_xml}/models/directories.rb | 6 +++--- .../storage/storage_xml}/models/directory.rb | 6 +++--- .../storage/storage_xml}/models/file.rb | 4 ++-- .../storage/storage_xml}/models/files.rb | 6 +++--- .../storage/storage_xml}/real.rb | 4 ++-- .../storage/storage_xml}/requests/copy_object.rb | 4 ++-- .../storage/storage_xml}/requests/delete_bucket.rb | 4 ++-- .../storage/storage_xml}/requests/delete_object.rb | 4 ++-- .../storage_xml}/requests/delete_object_url.rb | 4 ++-- .../storage/storage_xml}/requests/get_bucket.rb | 4 ++-- .../storage_xml}/requests/get_bucket_acl.rb | 4 ++-- .../storage/storage_xml}/requests/get_object.rb | 4 ++-- .../storage_xml}/requests/get_object_acl.rb | 4 ++-- .../storage_xml}/requests/get_object_http_url.rb | 4 ++-- .../storage_xml}/requests/get_object_https_url.rb | 4 ++-- .../storage_xml}/requests/get_object_url.rb | 8 ++++---- .../storage/storage_xml}/requests/get_service.rb | 4 ++-- .../storage/storage_xml}/requests/head_object.rb | 4 ++-- .../storage/storage_xml}/requests/put_bucket.rb | 4 ++-- .../storage_xml}/requests/put_bucket_acl.rb | 4 ++-- .../storage/storage_xml}/requests/put_object.rb | 4 ++-- .../storage_xml}/requests/put_object_acl.rb | 4 ++-- .../storage_xml}/requests/put_object_url.rb | 4 ++-- .../storage/storage_xml}/utils.rb | 6 +++--- test/integration/storage/storage_shared.rb | 2 +- test/unit/storage/test_json_requests.rb | 3 +-- test/unit/storage/test_xml_requests.rb | 3 +-- 62 files changed, 146 insertions(+), 151 deletions(-) rename lib/fog/{storage/google.rb => google/storage/storage.rb} (71%) rename lib/fog/{storage/google_json.rb => google/storage/storage_json.rb} (82%) rename lib/fog/{storage/google_json => google/storage/storage_json}/mock.rb (91%) rename lib/fog/{storage/google_json => google/storage/storage_json}/models/directories.rb (93%) rename lib/fog/{storage/google_json => google/storage/storage_json}/models/directory.rb (94%) rename lib/fog/{storage/google_json => google/storage/storage_json}/models/file.rb (98%) rename lib/fog/{storage/google_json => google/storage/storage_json}/models/files.rb (95%) rename lib/fog/{storage/google_json => google/storage/storage_json}/real.rb (98%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/copy_object.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/delete_bucket.rb (92%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/delete_object.rb (93%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/delete_object_url.rb (97%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_bucket.rb (97%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_bucket_acl.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object.rb (98%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object_acl.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object_http_url.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object_https_url.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object_metadata.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/get_object_url.rb (81%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/list_bucket_acl.rb (94%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/list_buckets.rb (95%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/list_object_acl.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/list_objects.rb (97%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/put_bucket.rb (97%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/put_bucket_acl.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/put_object.rb (99%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/put_object_acl.rb (96%) rename lib/fog/{storage/google_json => google/storage/storage_json}/requests/put_object_url.rb (98%) rename lib/fog/{storage/google_json => google/storage/storage_json}/utils.rb (91%) rename lib/fog/{storage/google_xml.rb => google/storage/storage_xml.rb} (68%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/mock.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/models/directories.rb (92%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/models/directory.rb (95%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/models/file.rb (99%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/models/files.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/real.rb (99%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/copy_object.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/delete_bucket.rb (96%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/delete_object.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/delete_object_url.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_bucket.rb (99%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_bucket_acl.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_object.rb (99%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_object_acl.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_object_http_url.rb (96%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_object_https_url.rb (96%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_object_url.rb (87%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/get_service.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/head_object.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/put_bucket.rb (98%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/put_bucket_acl.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/put_object.rb (99%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/put_object_acl.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/requests/put_object_url.rb (97%) rename lib/fog/{storage/google_xml => google/storage/storage_xml}/utils.rb (97%) diff --git a/lib/fog/bin/google.rb b/lib/fog/bin/google.rb index d8c6daeff3..cb70025af1 100644 --- a/lib/fog/bin/google.rb +++ b/lib/fog/bin/google.rb @@ -10,9 +10,9 @@ def class_for(key) when :monitoring Fog::Google::Monitoring when :storage - Fog::Storage::Google + Fog::Google::Storage when :storage_json - Fog::Storage::Google + Fog::Google::Storage when :sql Fog::Google::SQL when :pubsub diff --git a/lib/fog/google.rb b/lib/fog/google.rb index 6743bed536..0115c3e827 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -7,12 +7,14 @@ module Fog module Google autoload :Compute, 'fog/google/compute/compute' autoload :DNS, 'fog/google/dns/dns' - autoload :Mock, File.expand_path("../google/mock", __FILE__) autoload :Monitoring, File.expand_path("../google/monitoring", __FILE__) autoload :Pubsub, File.expand_path("../google/pubsub", __FILE__) autoload :Shared, File.expand_path("../google/shared", __FILE__) autoload :SQL, File.expand_path("../google/sql", __FILE__) + autoload :Storage, 'fog/google/storage/storage' + autoload :StorageJSON, 'fog/google/storage/storage_json' + autoload :StorageXML, 'fog/google/storage/storage_xml' extend Fog::Provider @@ -40,9 +42,4 @@ module Storage end end - module Storage - autoload :Google, File.expand_path("../storage/google", __FILE__) - autoload :GoogleJSON, File.expand_path("../storage/google_json", __FILE__) - autoload :GoogleXML, File.expand_path("../storage/google_xml", __FILE__) - end end diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 8780f749b2..58e2519584 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -43,7 +43,7 @@ def initialize_google_client(options) require "google/apis/dns_#{Fog::Google::DNS::GOOGLE_DNS_API_VERSION}" require "google/apis/pubsub_#{Fog::Google::Pubsub::GOOGLE_PUBSUB_API_VERSION}" require "google/apis/sqladmin_#{Fog::Google::SQL::GOOGLE_SQL_API_VERSION}" - require "google/apis/storage_#{Fog::Storage::GoogleJSON::GOOGLE_STORAGE_JSON_API_VERSION}" + require "google/apis/storage_#{Fog::Google::StorageJSON::GOOGLE_STORAGE_JSON_API_VERSION}" require "googleauth" rescue LoadError => error Fog::Errors::Error.new("Please install the google-api-client (>= 0.9) gem before using this provider") diff --git a/lib/fog/storage/google.rb b/lib/fog/google/storage/storage.rb similarity index 71% rename from lib/fog/storage/google.rb rename to lib/fog/google/storage/storage.rb index e02e29544c..fc48377285 100644 --- a/lib/fog/storage/google.rb +++ b/lib/fog/google/storage/storage.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class Google < Fog::Service + module Google + class Storage < Fog::Service def self.new(options = {}) begin fog_creds = Fog.credentials @@ -10,9 +10,9 @@ def self.new(options = {}) if options.keys.include?(:google_storage_access_key_id) || (!fog_creds.nil? && fog_creds.keys.include?(:google_storage_access_key_id)) - Fog::Storage::GoogleXML.new(options) + Fog::Google::StorageXML.new(options) else - Fog::Storage::GoogleJSON.new(options) + Fog::Google::StorageJSON.new(options) end end end diff --git a/lib/fog/storage/google_json.rb b/lib/fog/google/storage/storage_json.rb similarity index 82% rename from lib/fog/storage/google_json.rb rename to lib/fog/google/storage/storage_json.rb index def098ff01..bc5d59d0a3 100644 --- a/lib/fog/storage/google_json.rb +++ b/lib/fog/google/storage/storage_json.rb @@ -1,9 +1,9 @@ module Fog - module Storage - class GoogleJSON < Fog::Service - autoload :Mock, File.expand_path("../google_json/mock", __FILE__) - autoload :Real, File.expand_path("../google_json/real", __FILE__) - autoload :Utils, File.expand_path("../google_json/utils", __FILE__) + module Google + class StorageJSON < Fog::Service + autoload :Mock, 'fog/google/storage/storage_json/mock' + autoload :Real, 'fog/google/storage/storage_json/real' + autoload :Utils, 'fog/google/storage/storage_json/utils' requires :google_project recognizes( @@ -33,7 +33,7 @@ class GoogleJSON < Fog::Service ## # Models - model_path "fog/storage/google_json/models" + model_path "fog/google/storage/storage_json/models" collection :directories model :directory @@ -43,7 +43,7 @@ class GoogleJSON < Fog::Service ## # Requests - request_path "fog/storage/google_json/requests" + request_path "fog/google/storage/storage_json/requests" request :copy_object request :delete_bucket request :delete_object diff --git a/lib/fog/storage/google_json/mock.rb b/lib/fog/google/storage/storage_json/mock.rb similarity index 91% rename from lib/fog/storage/google_json/mock.rb rename to lib/fog/google/storage/storage_json/mock.rb index d586e4aa91..99c03cb67c 100644 --- a/lib/fog/storage/google_json/mock.rb +++ b/lib/fog/google/storage/storage_json/mock.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Mock include Utils include Fog::Google::Shared diff --git a/lib/fog/storage/google_json/models/directories.rb b/lib/fog/google/storage/storage_json/models/directories.rb similarity index 93% rename from lib/fog/storage/google_json/models/directories.rb rename to lib/fog/google/storage/storage_json/models/directories.rb index 46260668a2..6323e2be31 100644 --- a/lib/fog/storage/google_json/models/directories.rb +++ b/lib/fog/google/storage/storage_json/models/directories.rb @@ -1,8 +1,8 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Directories < Fog::Collection - model Fog::Storage::GoogleJSON::Directory + model Fog::Google::StorageJSON::Directory def all(opts = {}) data = service.list_buckets(opts).to_h[:items] || [] diff --git a/lib/fog/storage/google_json/models/directory.rb b/lib/fog/google/storage/storage_json/models/directory.rb similarity index 94% rename from lib/fog/storage/google_json/models/directory.rb rename to lib/fog/google/storage/storage_json/models/directory.rb index 35bd28f87d..6d17b958fe 100644 --- a/lib/fog/storage/google_json/models/directory.rb +++ b/lib/fog/google/storage/storage_json/models/directory.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON ## # Represents a Google Storage bucket class Directory < Fog::Model @@ -39,7 +39,7 @@ def destroy def files(attr = {}) @files ||= begin - Fog::Storage::GoogleJSON::Files.new( + Fog::Google::StorageJSON::Files.new( attr.merge(:directory => self, :service => service) ) end diff --git a/lib/fog/storage/google_json/models/file.rb b/lib/fog/google/storage/storage_json/models/file.rb similarity index 98% rename from lib/fog/storage/google_json/models/file.rb rename to lib/fog/google/storage/storage_json/models/file.rb index b9f49e7249..d2c466f36d 100644 --- a/lib/fog/storage/google_json/models/file.rb +++ b/lib/fog/google/storage/storage_json/models/file.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class File < Fog::Model identity :key, :aliases => ["Key", :name] @@ -102,7 +102,7 @@ def save FILE_INSERTABLE_FIELDS.map { |k| [k, attributes[k]] } .reject { |pair| pair[1].nil? } ] - + options[:predefined_acl] ||= @predefined_acl service.put_object(directory.key, key, body, options) diff --git a/lib/fog/storage/google_json/models/files.rb b/lib/fog/google/storage/storage_json/models/files.rb similarity index 95% rename from lib/fog/storage/google_json/models/files.rb rename to lib/fog/google/storage/storage_json/models/files.rb index 91909465a6..87c905b283 100644 --- a/lib/fog/storage/google_json/models/files.rb +++ b/lib/fog/google/storage/storage_json/models/files.rb @@ -1,8 +1,8 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Files < Fog::Collection - model Fog::Storage::GoogleJSON::File + model Fog::Google::StorageJSON::File extend Fog::Deprecation deprecate :get_url, :get_https_url diff --git a/lib/fog/storage/google_json/real.rb b/lib/fog/google/storage/storage_json/real.rb similarity index 98% rename from lib/fog/storage/google_json/real.rb rename to lib/fog/google/storage/storage_json/real.rb index 799f8d8ef0..60e8a9805c 100644 --- a/lib/fog/storage/google_json/real.rb +++ b/lib/fog/google/storage/storage_json/real.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real include Utils include Fog::Google::Shared diff --git a/lib/fog/storage/google_json/requests/copy_object.rb b/lib/fog/google/storage/storage_json/requests/copy_object.rb similarity index 96% rename from lib/fog/storage/google_json/requests/copy_object.rb rename to lib/fog/google/storage/storage_json/requests/copy_object.rb index a3166b67b1..8b7429b033 100644 --- a/lib/fog/storage/google_json/requests/copy_object.rb +++ b/lib/fog/google/storage/storage_json/requests/copy_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Copy an object from one Google Storage bucket to another # diff --git a/lib/fog/storage/google_json/requests/delete_bucket.rb b/lib/fog/google/storage/storage_json/requests/delete_bucket.rb similarity index 92% rename from lib/fog/storage/google_json/requests/delete_bucket.rb rename to lib/fog/google/storage/storage_json/requests/delete_bucket.rb index e5bfe0d692..a6f2f1eddd 100644 --- a/lib/fog/storage/google_json/requests/delete_bucket.rb +++ b/lib/fog/google/storage/storage_json/requests/delete_bucket.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Delete an Google Storage bucket # https://cloud.google.com/storage/docs/json_api/v1/buckets/delete diff --git a/lib/fog/storage/google_json/requests/delete_object.rb b/lib/fog/google/storage/storage_json/requests/delete_object.rb similarity index 93% rename from lib/fog/storage/google_json/requests/delete_object.rb rename to lib/fog/google/storage/storage_json/requests/delete_object.rb index 97949d87db..394dc3d07d 100644 --- a/lib/fog/storage/google_json/requests/delete_object.rb +++ b/lib/fog/google/storage/storage_json/requests/delete_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Delete an object from Google Storage # https://cloud.google.com/storage/docs/json_api/v1/objects/delete diff --git a/lib/fog/storage/google_json/requests/delete_object_url.rb b/lib/fog/google/storage/storage_json/requests/delete_object_url.rb similarity index 97% rename from lib/fog/storage/google_json/requests/delete_object_url.rb rename to lib/fog/google/storage/storage_json/requests/delete_object_url.rb index f3d19c8107..ca0bf0ce38 100644 --- a/lib/fog/storage/google_json/requests/delete_object_url.rb +++ b/lib/fog/google/storage/storage_json/requests/delete_object_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get an expiring object url from Google Storage for deleting an object # https://cloud.google.com/storage/docs/access-control#Signed-URLs diff --git a/lib/fog/storage/google_json/requests/get_bucket.rb b/lib/fog/google/storage/storage_json/requests/get_bucket.rb similarity index 97% rename from lib/fog/storage/google_json/requests/get_bucket.rb rename to lib/fog/google/storage/storage_json/requests/get_bucket.rb index 61a696a177..549a1cd3a2 100644 --- a/lib/fog/storage/google_json/requests/get_bucket.rb +++ b/lib/fog/google/storage/storage_json/requests/get_bucket.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # List information about objects in an Google Storage bucket # # https://cloud.google.com/storage/docs/json_api/v1/buckets#resource diff --git a/lib/fog/storage/google_json/requests/get_bucket_acl.rb b/lib/fog/google/storage/storage_json/requests/get_bucket_acl.rb similarity index 96% rename from lib/fog/storage/google_json/requests/get_bucket_acl.rb rename to lib/fog/google/storage/storage_json/requests/get_bucket_acl.rb index 29fe40d63f..ef7148321e 100644 --- a/lib/fog/storage/google_json/requests/get_bucket_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/get_bucket_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get access control list entry for an Google Storage bucket # @see https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/get diff --git a/lib/fog/storage/google_json/requests/get_object.rb b/lib/fog/google/storage/storage_json/requests/get_object.rb similarity index 98% rename from lib/fog/storage/google_json/requests/get_object.rb rename to lib/fog/google/storage/storage_json/requests/get_object.rb index d0659a2ee7..ff07075111 100644 --- a/lib/fog/storage/google_json/requests/get_object.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object.rb @@ -1,8 +1,8 @@ require "tempfile" module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get an object from Google Storage # @see https://cloud.google.com/storage/docs/json_api/v1/objects/get diff --git a/lib/fog/storage/google_json/requests/get_object_acl.rb b/lib/fog/google/storage/storage_json/requests/get_object_acl.rb similarity index 96% rename from lib/fog/storage/google_json/requests/get_object_acl.rb rename to lib/fog/google/storage/storage_json/requests/get_object_acl.rb index 99b15ac836..9bc9ac70b6 100644 --- a/lib/fog/storage/google_json/requests/get_object_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get access control list for an Google Storage object # https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get diff --git a/lib/fog/storage/google_json/requests/get_object_http_url.rb b/lib/fog/google/storage/storage_json/requests/get_object_http_url.rb similarity index 96% rename from lib/fog/storage/google_json/requests/get_object_http_url.rb rename to lib/fog/google/storage/storage_json/requests/get_object_http_url.rb index c00c4d56f7..b8ce6f6712 100644 --- a/lib/fog/storage/google_json/requests/get_object_http_url.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object_http_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON module GetObjectHttpUrl def get_object_http_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name diff --git a/lib/fog/storage/google_json/requests/get_object_https_url.rb b/lib/fog/google/storage/storage_json/requests/get_object_https_url.rb similarity index 96% rename from lib/fog/storage/google_json/requests/get_object_https_url.rb rename to lib/fog/google/storage/storage_json/requests/get_object_https_url.rb index 6cd4213e8c..77aeab0a0f 100644 --- a/lib/fog/storage/google_json/requests/get_object_https_url.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object_https_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON module GetObjectHttpsUrl def get_object_https_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name diff --git a/lib/fog/storage/google_json/requests/get_object_metadata.rb b/lib/fog/google/storage/storage_json/requests/get_object_metadata.rb similarity index 96% rename from lib/fog/storage/google_json/requests/get_object_metadata.rb rename to lib/fog/google/storage/storage_json/requests/get_object_metadata.rb index 34c17eb1d0..679448c295 100644 --- a/lib/fog/storage/google_json/requests/get_object_metadata.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object_metadata.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Fetch metadata for an object in Google Storage # diff --git a/lib/fog/storage/google_json/requests/get_object_url.rb b/lib/fog/google/storage/storage_json/requests/get_object_url.rb similarity index 81% rename from lib/fog/storage/google_json/requests/get_object_url.rb rename to lib/fog/google/storage/storage_json/requests/get_object_url.rb index 78f5befa71..b5b418bbc1 100644 --- a/lib/fog/storage/google_json/requests/get_object_url.rb +++ b/lib/fog/google/storage/storage_json/requests/get_object_url.rb @@ -1,18 +1,18 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get an expiring object url from GCS # Deprecated, redirects to get_object_https_url.rb def get_object_url(bucket_name, object_name, expires, options = {}) - Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})") + Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})") get_object_https_url(bucket_name, object_name, expires, options) end end class Mock # :nodoc:all def get_object_url(bucket_name, object_name, expires, options = {}) - Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})") + Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})") get_object_https_url(bucket_name, object_name, expires, options) end end diff --git a/lib/fog/storage/google_json/requests/list_bucket_acl.rb b/lib/fog/google/storage/storage_json/requests/list_bucket_acl.rb similarity index 94% rename from lib/fog/storage/google_json/requests/list_bucket_acl.rb rename to lib/fog/google/storage/storage_json/requests/list_bucket_acl.rb index 091d258379..721042138f 100644 --- a/lib/fog/storage/google_json/requests/list_bucket_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/list_bucket_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get access control list for an Google Storage bucket # @see https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/list diff --git a/lib/fog/storage/google_json/requests/list_buckets.rb b/lib/fog/google/storage/storage_json/requests/list_buckets.rb similarity index 95% rename from lib/fog/storage/google_json/requests/list_buckets.rb rename to lib/fog/google/storage/storage_json/requests/list_buckets.rb index 91e74f0489..9f26fdbebd 100644 --- a/lib/fog/storage/google_json/requests/list_buckets.rb +++ b/lib/fog/google/storage/storage_json/requests/list_buckets.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Retrieves a list of buckets for a given project # https://cloud.google.com/storage/docs/json_api/v1/buckets/list diff --git a/lib/fog/storage/google_json/requests/list_object_acl.rb b/lib/fog/google/storage/storage_json/requests/list_object_acl.rb similarity index 96% rename from lib/fog/storage/google_json/requests/list_object_acl.rb rename to lib/fog/google/storage/storage_json/requests/list_object_acl.rb index df14e8a30c..6d75111631 100644 --- a/lib/fog/storage/google_json/requests/list_object_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/list_object_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # List access control list for an Google Storage object # https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get diff --git a/lib/fog/storage/google_json/requests/list_objects.rb b/lib/fog/google/storage/storage_json/requests/list_objects.rb similarity index 97% rename from lib/fog/storage/google_json/requests/list_objects.rb rename to lib/fog/google/storage/storage_json/requests/list_objects.rb index 483d095a3f..179818dc36 100644 --- a/lib/fog/storage/google_json/requests/list_objects.rb +++ b/lib/fog/google/storage/storage_json/requests/list_objects.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Lists objects in a bucket matching some criteria. # diff --git a/lib/fog/storage/google_json/requests/put_bucket.rb b/lib/fog/google/storage/storage_json/requests/put_bucket.rb similarity index 97% rename from lib/fog/storage/google_json/requests/put_bucket.rb rename to lib/fog/google/storage/storage_json/requests/put_bucket.rb index 4daaea2a8c..b8d1c58b7b 100644 --- a/lib/fog/storage/google_json/requests/put_bucket.rb +++ b/lib/fog/google/storage/storage_json/requests/put_bucket.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Create a Google Storage bucket # @see https://cloud.google.com/storage/docs/json_api/v1/buckets/insert diff --git a/lib/fog/storage/google_json/requests/put_bucket_acl.rb b/lib/fog/google/storage/storage_json/requests/put_bucket_acl.rb similarity index 96% rename from lib/fog/storage/google_json/requests/put_bucket_acl.rb rename to lib/fog/google/storage/storage_json/requests/put_bucket_acl.rb index 57135f24d0..2fc833d4d7 100644 --- a/lib/fog/storage/google_json/requests/put_bucket_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/put_bucket_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Change access control list for an Google Storage bucket # https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/insert diff --git a/lib/fog/storage/google_json/requests/put_object.rb b/lib/fog/google/storage/storage_json/requests/put_object.rb similarity index 99% rename from lib/fog/storage/google_json/requests/put_object.rb rename to lib/fog/google/storage/storage_json/requests/put_object.rb index 0ff3bf2ae3..dcb1da6ebe 100644 --- a/lib/fog/storage/google_json/requests/put_object.rb +++ b/lib/fog/google/storage/storage_json/requests/put_object.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Create an object in an Google Storage bucket # https://cloud.google.com/storage/docs/json_api/v1/objects/insert diff --git a/lib/fog/storage/google_json/requests/put_object_acl.rb b/lib/fog/google/storage/storage_json/requests/put_object_acl.rb similarity index 96% rename from lib/fog/storage/google_json/requests/put_object_acl.rb rename to lib/fog/google/storage/storage_json/requests/put_object_acl.rb index 4f56f42014..826c44ba67 100644 --- a/lib/fog/storage/google_json/requests/put_object_acl.rb +++ b/lib/fog/google/storage/storage_json/requests/put_object_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Change access control list for an Google Storage object # diff --git a/lib/fog/storage/google_json/requests/put_object_url.rb b/lib/fog/google/storage/storage_json/requests/put_object_url.rb similarity index 98% rename from lib/fog/storage/google_json/requests/put_object_url.rb rename to lib/fog/google/storage/storage_json/requests/put_object_url.rb index be819259b0..39a658f766 100644 --- a/lib/fog/storage/google_json/requests/put_object_url.rb +++ b/lib/fog/google/storage/storage_json/requests/put_object_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON class Real # Get an expiring object url from Google Storage for putting an object # https://cloud.google.com/storage/docs/access-control#Signed-URLs diff --git a/lib/fog/storage/google_json/utils.rb b/lib/fog/google/storage/storage_json/utils.rb similarity index 91% rename from lib/fog/storage/google_json/utils.rb rename to lib/fog/google/storage/storage_json/utils.rb index f9f8daac56..32c7dcea4c 100644 --- a/lib/fog/storage/google_json/utils.rb +++ b/lib/fog/google/storage/storage_json/utils.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleJSON + module Google + class StorageJSON module Utils def http_url(params, expires) "http://" << host_path_query(params, expires) @@ -11,7 +11,7 @@ def https_url(params, expires) end def url(params, expires) - Fog::Logger.deprecation("Fog::Storage::Google => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") + Fog::Logger.deprecation("Fog::Google::Storage => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") https_url(params, expires) end diff --git a/lib/fog/storage/google_xml.rb b/lib/fog/google/storage/storage_xml.rb similarity index 68% rename from lib/fog/storage/google_xml.rb rename to lib/fog/google/storage/storage_xml.rb index 7805410348..31660bc7be 100644 --- a/lib/fog/storage/google_xml.rb +++ b/lib/fog/google/storage/storage_xml.rb @@ -1,20 +1,20 @@ module Fog - module Storage - class GoogleXML < Fog::Service - autoload :Mock, File.expand_path("../google_xml/mock", __FILE__) - autoload :Real, File.expand_path("../google_xml/real", __FILE__) - autoload :Utils, File.expand_path("../google_xml/utils", __FILE__) + module Google + class StorageXML < Fog::Service + autoload :Mock, 'fog/google/storage/storage_xml/mock' + autoload :Real, 'fog/google/storage/storage_xml/real' + autoload :Utils, 'fog/google/storage/storage_xml/utils' requires :google_storage_access_key_id, :google_storage_secret_access_key recognizes :host, :port, :scheme, :persistent, :path_style - model_path "fog/storage/google_xml/models" + model_path "fog/google/storage/storage_xml/models" collection :directories model :directory collection :files model :file - request_path "fog/storage/google_xml/requests" + request_path "fog/google/storage/storage_xml/requests" request :copy_object request :delete_bucket request :delete_object diff --git a/lib/fog/storage/google_xml/mock.rb b/lib/fog/google/storage/storage_xml/mock.rb similarity index 98% rename from lib/fog/storage/google_xml/mock.rb rename to lib/fog/google/storage/storage_xml/mock.rb index e85ee6b401..a6e5760ab5 100644 --- a/lib/fog/storage/google_xml/mock.rb +++ b/lib/fog/google/storage/storage_xml/mock.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Mock include Utils diff --git a/lib/fog/storage/google_xml/models/directories.rb b/lib/fog/google/storage/storage_xml/models/directories.rb similarity index 92% rename from lib/fog/storage/google_xml/models/directories.rb rename to lib/fog/google/storage/storage_xml/models/directories.rb index b3bec62fe7..d59dfb05f9 100644 --- a/lib/fog/storage/google_xml/models/directories.rb +++ b/lib/fog/google/storage/storage_xml/models/directories.rb @@ -1,8 +1,8 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Directories < Fog::Collection - model Fog::Storage::GoogleXML::Directory + model Fog::Google::StorageXML::Directory def all data = service.get_service.body["Buckets"] diff --git a/lib/fog/storage/google_xml/models/directory.rb b/lib/fog/google/storage/storage_xml/models/directory.rb similarity index 95% rename from lib/fog/storage/google_xml/models/directory.rb rename to lib/fog/google/storage/storage_xml/models/directory.rb index 04391c42d1..288419a072 100644 --- a/lib/fog/storage/google_xml/models/directory.rb +++ b/lib/fog/google/storage/storage_xml/models/directory.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Directory < Fog::Model identity :key, :aliases => %w(Name name) @@ -23,7 +23,7 @@ def destroy def files @files ||= begin - Fog::Storage::GoogleXML::Files.new( + Fog::Google::StorageXML::Files.new( :directory => self, :service => service ) diff --git a/lib/fog/storage/google_xml/models/file.rb b/lib/fog/google/storage/storage_xml/models/file.rb similarity index 99% rename from lib/fog/storage/google_xml/models/file.rb rename to lib/fog/google/storage/storage_xml/models/file.rb index 3069796c2b..fc0a5f3c0a 100644 --- a/lib/fog/storage/google_xml/models/file.rb +++ b/lib/fog/google/storage/storage_xml/models/file.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class File < Fog::Model identity :key, :aliases => "Key" diff --git a/lib/fog/storage/google_xml/models/files.rb b/lib/fog/google/storage/storage_xml/models/files.rb similarity index 97% rename from lib/fog/storage/google_xml/models/files.rb rename to lib/fog/google/storage/storage_xml/models/files.rb index 53d29b8817..31dd19e758 100644 --- a/lib/fog/storage/google_xml/models/files.rb +++ b/lib/fog/google/storage/storage_xml/models/files.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Files < Fog::Collection extend Fog::Deprecation deprecate :get_url, :get_https_url @@ -13,7 +13,7 @@ class Files < Fog::Collection attribute :max_keys, :aliases => ["MaxKeys", "max-keys"] attribute :prefix, :aliases => "Prefix" - model Fog::Storage::GoogleXML::File + model Fog::Google::StorageXML::File def all(options = {}) requires :directory diff --git a/lib/fog/storage/google_xml/real.rb b/lib/fog/google/storage/storage_xml/real.rb similarity index 99% rename from lib/fog/storage/google_xml/real.rb rename to lib/fog/google/storage/storage_xml/real.rb index bb98082a57..166e181450 100644 --- a/lib/fog/storage/google_xml/real.rb +++ b/lib/fog/google/storage/storage_xml/real.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real include Utils diff --git a/lib/fog/storage/google_xml/requests/copy_object.rb b/lib/fog/google/storage/storage_xml/requests/copy_object.rb similarity index 98% rename from lib/fog/storage/google_xml/requests/copy_object.rb rename to lib/fog/google/storage/storage_xml/requests/copy_object.rb index b55c295098..f7b9d9e9cd 100644 --- a/lib/fog/storage/google_xml/requests/copy_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/copy_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Copy an object from one Google Storage bucket to another # diff --git a/lib/fog/storage/google_xml/requests/delete_bucket.rb b/lib/fog/google/storage/storage_xml/requests/delete_bucket.rb similarity index 96% rename from lib/fog/storage/google_xml/requests/delete_bucket.rb rename to lib/fog/google/storage/storage_xml/requests/delete_bucket.rb index 59f6651e57..d95e381cad 100644 --- a/lib/fog/storage/google_xml/requests/delete_bucket.rb +++ b/lib/fog/google/storage/storage_xml/requests/delete_bucket.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Delete an Google Storage bucket # diff --git a/lib/fog/storage/google_xml/requests/delete_object.rb b/lib/fog/google/storage/storage_xml/requests/delete_object.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/delete_object.rb rename to lib/fog/google/storage/storage_xml/requests/delete_object.rb index 2220265d63..0377b41062 100644 --- a/lib/fog/storage/google_xml/requests/delete_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/delete_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Delete an object from Google Storage # diff --git a/lib/fog/storage/google_xml/requests/delete_object_url.rb b/lib/fog/google/storage/storage_xml/requests/delete_object_url.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/delete_object_url.rb rename to lib/fog/google/storage/storage_xml/requests/delete_object_url.rb index 567be17980..097a4c4f58 100644 --- a/lib/fog/storage/google_xml/requests/delete_object_url.rb +++ b/lib/fog/google/storage/storage_xml/requests/delete_object_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get an expiring object url from Google Storage for deleting an object # diff --git a/lib/fog/storage/google_xml/requests/get_bucket.rb b/lib/fog/google/storage/storage_xml/requests/get_bucket.rb similarity index 99% rename from lib/fog/storage/google_xml/requests/get_bucket.rb rename to lib/fog/google/storage/storage_xml/requests/get_bucket.rb index 206c3d0725..18a2db6a9f 100644 --- a/lib/fog/storage/google_xml/requests/get_bucket.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_bucket.rb @@ -1,7 +1,7 @@ require "pp" module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # List information about objects in an Google Storage bucket # diff --git a/lib/fog/storage/google_xml/requests/get_bucket_acl.rb b/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb similarity index 98% rename from lib/fog/storage/google_xml/requests/get_bucket_acl.rb rename to lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb index bf596cb1ae..9c1bc7bf8a 100644 --- a/lib/fog/storage/google_xml/requests/get_bucket_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get access control list for an Google Storage bucket # diff --git a/lib/fog/storage/google_xml/requests/get_object.rb b/lib/fog/google/storage/storage_xml/requests/get_object.rb similarity index 99% rename from lib/fog/storage/google_xml/requests/get_object.rb rename to lib/fog/google/storage/storage_xml/requests/get_object.rb index 1e2f5427ca..ac9ae3f52f 100644 --- a/lib/fog/storage/google_xml/requests/get_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get an object from Google Storage # diff --git a/lib/fog/storage/google_xml/requests/get_object_acl.rb b/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb similarity index 98% rename from lib/fog/storage/google_xml/requests/get_object_acl.rb rename to lib/fog/google/storage/storage_xml/requests/get_object_acl.rb index 27c978fcf9..04563521d2 100644 --- a/lib/fog/storage/google_xml/requests/get_object_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get access control list for an Google Storage object # diff --git a/lib/fog/storage/google_xml/requests/get_object_http_url.rb b/lib/fog/google/storage/storage_xml/requests/get_object_http_url.rb similarity index 96% rename from lib/fog/storage/google_xml/requests/get_object_http_url.rb rename to lib/fog/google/storage/storage_xml/requests/get_object_http_url.rb index a525a3b730..b02cc6b800 100644 --- a/lib/fog/storage/google_xml/requests/get_object_http_url.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object_http_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML module GetObjectHttpUrl def get_object_http_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name diff --git a/lib/fog/storage/google_xml/requests/get_object_https_url.rb b/lib/fog/google/storage/storage_xml/requests/get_object_https_url.rb similarity index 96% rename from lib/fog/storage/google_xml/requests/get_object_https_url.rb rename to lib/fog/google/storage/storage_xml/requests/get_object_https_url.rb index c6c6f2c7c9..422002c0aa 100644 --- a/lib/fog/storage/google_xml/requests/get_object_https_url.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object_https_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML module GetObjectHttpsUrl def get_object_https_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name diff --git a/lib/fog/storage/google_xml/requests/get_object_url.rb b/lib/fog/google/storage/storage_xml/requests/get_object_url.rb similarity index 87% rename from lib/fog/storage/google_xml/requests/get_object_url.rb rename to lib/fog/google/storage/storage_xml/requests/get_object_url.rb index e3db3565e6..f44a67c0c5 100644 --- a/lib/fog/storage/google_xml/requests/get_object_url.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get an expiring object url from Google Storage # @@ -15,14 +15,14 @@ class Real # * body<~String> - url for object def get_object_url(bucket_name, object_name, expires, options = {}) - Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})") + Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})") get_object_https_url(bucket_name, object_name, expires, options) end end class Mock # :nodoc:all def get_object_url(bucket_name, object_name, expires, options = {}) - Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})") + Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})") get_object_https_url(bucket_name, object_name, expires, options) end end diff --git a/lib/fog/storage/google_xml/requests/get_service.rb b/lib/fog/google/storage/storage_xml/requests/get_service.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/get_service.rb rename to lib/fog/google/storage/storage_xml/requests/get_service.rb index f78c9ba8a9..7151041eb5 100644 --- a/lib/fog/storage/google_xml/requests/get_service.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_service.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # List information about Google Storage buckets for authorized user # diff --git a/lib/fog/storage/google_xml/requests/head_object.rb b/lib/fog/google/storage/storage_xml/requests/head_object.rb similarity index 98% rename from lib/fog/storage/google_xml/requests/head_object.rb rename to lib/fog/google/storage/storage_xml/requests/head_object.rb index 09fa2f9355..8849d2b95a 100644 --- a/lib/fog/storage/google_xml/requests/head_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/head_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get headers for an object from Google Storage # diff --git a/lib/fog/storage/google_xml/requests/put_bucket.rb b/lib/fog/google/storage/storage_xml/requests/put_bucket.rb similarity index 98% rename from lib/fog/storage/google_xml/requests/put_bucket.rb rename to lib/fog/google/storage/storage_xml/requests/put_bucket.rb index 134ebc4ea8..03ce55d843 100644 --- a/lib/fog/storage/google_xml/requests/put_bucket.rb +++ b/lib/fog/google/storage/storage_xml/requests/put_bucket.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Create an Google Storage bucket # diff --git a/lib/fog/storage/google_xml/requests/put_bucket_acl.rb b/lib/fog/google/storage/storage_xml/requests/put_bucket_acl.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/put_bucket_acl.rb rename to lib/fog/google/storage/storage_xml/requests/put_bucket_acl.rb index 6684e9198b..909b5dd29b 100644 --- a/lib/fog/storage/google_xml/requests/put_bucket_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/put_bucket_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Mock def put_bucket_acl(_bucket_name, _acl) Fog::Mock.not_implemented diff --git a/lib/fog/storage/google_xml/requests/put_object.rb b/lib/fog/google/storage/storage_xml/requests/put_object.rb similarity index 99% rename from lib/fog/storage/google_xml/requests/put_object.rb rename to lib/fog/google/storage/storage_xml/requests/put_object.rb index 9f74dbcf1a..2b992481d0 100644 --- a/lib/fog/storage/google_xml/requests/put_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/put_object.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Create an object in an Google Storage bucket # diff --git a/lib/fog/storage/google_xml/requests/put_object_acl.rb b/lib/fog/google/storage/storage_xml/requests/put_object_acl.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/put_object_acl.rb rename to lib/fog/google/storage/storage_xml/requests/put_object_acl.rb index 6457d387ab..9cab9cddcd 100644 --- a/lib/fog/storage/google_xml/requests/put_object_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/put_object_acl.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # TODO: move this methods to helper to use them with put_bucket_acl request def tag(name, value) diff --git a/lib/fog/storage/google_xml/requests/put_object_url.rb b/lib/fog/google/storage/storage_xml/requests/put_object_url.rb similarity index 97% rename from lib/fog/storage/google_xml/requests/put_object_url.rb rename to lib/fog/google/storage/storage_xml/requests/put_object_url.rb index 18ae8bc6b9..c90dbf112b 100644 --- a/lib/fog/storage/google_xml/requests/put_object_url.rb +++ b/lib/fog/google/storage/storage_xml/requests/put_object_url.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML class Real # Get an expiring object url from Google Storage for putting an object # diff --git a/lib/fog/storage/google_xml/utils.rb b/lib/fog/google/storage/storage_xml/utils.rb similarity index 97% rename from lib/fog/storage/google_xml/utils.rb rename to lib/fog/google/storage/storage_xml/utils.rb index 48ae747381..86261592cb 100644 --- a/lib/fog/storage/google_xml/utils.rb +++ b/lib/fog/google/storage/storage_xml/utils.rb @@ -1,6 +1,6 @@ module Fog - module Storage - class GoogleXML + module Google + class StorageXML module Utils # https://cloud.google.com/storage/docs/access-control#predefined-acl VALID_ACLS = [ @@ -22,7 +22,7 @@ def https_url(params, expires) end def url(params, expires) - Fog::Logger.deprecation("Fog::Storage::Google => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") + Fog::Logger.deprecation("Fog::Google::Storage => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") https_url(params, expires) end diff --git a/test/integration/storage/storage_shared.rb b/test/integration/storage/storage_shared.rb index b82313d9f5..95a64fddce 100644 --- a/test/integration/storage/storage_shared.rb +++ b/test/integration/storage/storage_shared.rb @@ -6,7 +6,7 @@ class StorageShared < FogIntegrationTest def setup - @client = Fog::Storage::Google.new + @client = Fog::Google::Storage.new # Enable retries during the suite. This prevents us from # having to manually rate limit our requests. ::Google::Apis::RequestOptions.default.retries = 5 diff --git a/test/unit/storage/test_json_requests.rb b/test/unit/storage/test_json_requests.rb index 1d4d87475a..d08a301817 100644 --- a/test/unit/storage/test_json_requests.rb +++ b/test/unit/storage/test_json_requests.rb @@ -3,8 +3,7 @@ class UnitTestJsonRequests < MiniTest::Test def setup Fog.mock! - @client = Fog::Storage.new(provider: "google", - google_client_email: "", + @client = Fog::Google::Storage.new(google_client_email: "", google_project: "", google_json_key_location: "") end diff --git a/test/unit/storage/test_xml_requests.rb b/test/unit/storage/test_xml_requests.rb index f8e0d83ae8..69b245178e 100644 --- a/test/unit/storage/test_xml_requests.rb +++ b/test/unit/storage/test_xml_requests.rb @@ -3,8 +3,7 @@ class UnitTestXMLRequests < MiniTest::Test def setup Fog.mock! - @client = Fog::Storage.new(provider: "google", - google_storage_access_key_id: "", + @client = Fog::Google::Storage.new(google_storage_access_key_id: "", google_storage_secret_access_key: "") end From 422e28d6e6cb0c6f4dbef2283b5bb605a9900064 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 18:54:48 +1000 Subject: [PATCH 05/46] Rename Fog::Parsers::Storage::Google to Fog::Google::Parsers::Storage --- lib/fog/google.rb | 7 ++----- .../parsers/storage}/access_control_list.rb | 6 +++--- .../parsers/storage}/copy_object.rb | 6 +++--- .../parsers/storage}/get_bucket.rb | 6 +++--- .../parsers/storage}/get_bucket_logging.rb | 6 +++--- .../storage}/get_bucket_object_versions.rb | 6 +++--- .../parsers/storage}/get_bucket_versioning.rb | 6 +++--- .../parsers/storage}/get_request_payment.rb | 6 +++--- .../parsers/storage}/get_service.rb | 6 +++--- lib/fog/google/parsers/storage/storage.rb | 15 +++++++++++++++ .../storage/storage_xml/requests/copy_object.rb | 2 +- .../storage/storage_xml/requests/get_bucket.rb | 2 +- .../storage_xml/requests/get_bucket_acl.rb | 2 +- .../storage_xml/requests/get_object_acl.rb | 2 +- .../storage/storage_xml/requests/get_service.rb | 2 +- lib/fog/parsers/storage/google.rb | 15 --------------- 16 files changed, 46 insertions(+), 49 deletions(-) rename lib/fog/{parsers/storage/google => google/parsers/storage}/access_control_list.rb (95%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/copy_object.rb (85%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_bucket.rb (96%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_bucket_logging.rb (94%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_bucket_object_versions.rb (97%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_bucket_versioning.rb (87%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_request_payment.rb (81%) rename lib/fog/{parsers/storage/google => google/parsers/storage}/get_service.rb (91%) create mode 100644 lib/fog/google/parsers/storage/storage.rb delete mode 100644 lib/fog/parsers/storage/google.rb diff --git a/lib/fog/google.rb b/lib/fog/google.rb index 0115c3e827..82b55c5c04 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -34,12 +34,9 @@ def self.escape(str, extra_exclude_chars = "") "%" + Regexp.last_match(1).unpack("H2" * Regexp.last_match(1).bytesize).join("%").upcase end end - end - module Parsers - module Storage - autoload :Google, File.expand_path("../parsers/storage/google", __FILE__) + module Parsers + autoload :Storage, 'fog/google/parsers/storage/storage' end end - end diff --git a/lib/fog/parsers/storage/google/access_control_list.rb b/lib/fog/google/parsers/storage/access_control_list.rb similarity index 95% rename from lib/fog/parsers/storage/google/access_control_list.rb rename to lib/fog/google/parsers/storage/access_control_list.rb index 932803086f..68ad1a7b34 100644 --- a/lib/fog/parsers/storage/google/access_control_list.rb +++ b/lib/fog/google/parsers/storage/access_control_list.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class AccessControlList < Fog::Parsers::Base def reset @in_entries = false diff --git a/lib/fog/parsers/storage/google/copy_object.rb b/lib/fog/google/parsers/storage/copy_object.rb similarity index 85% rename from lib/fog/parsers/storage/google/copy_object.rb rename to lib/fog/google/parsers/storage/copy_object.rb index 0730f9ca04..aa91bf3087 100644 --- a/lib/fog/parsers/storage/google/copy_object.rb +++ b/lib/fog/google/parsers/storage/copy_object.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class CopyObject < Fog::Parsers::Base def end_element(name) case name diff --git a/lib/fog/parsers/storage/google/get_bucket.rb b/lib/fog/google/parsers/storage/get_bucket.rb similarity index 96% rename from lib/fog/parsers/storage/google/get_bucket.rb rename to lib/fog/google/parsers/storage/get_bucket.rb index ae638754f8..677329d7c7 100644 --- a/lib/fog/parsers/storage/google/get_bucket.rb +++ b/lib/fog/google/parsers/storage/get_bucket.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class GetBucket < Fog::Parsers::Base def reset @object = { "Owner" => {} } diff --git a/lib/fog/parsers/storage/google/get_bucket_logging.rb b/lib/fog/google/parsers/storage/get_bucket_logging.rb similarity index 94% rename from lib/fog/parsers/storage/google/get_bucket_logging.rb rename to lib/fog/google/parsers/storage/get_bucket_logging.rb index 0017c8288f..9537333e72 100644 --- a/lib/fog/parsers/storage/google/get_bucket_logging.rb +++ b/lib/fog/google/parsers/storage/get_bucket_logging.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class AccessControlList < Fog::Parsers::Base def reset @grant = { "Grantee" => {} } diff --git a/lib/fog/parsers/storage/google/get_bucket_object_versions.rb b/lib/fog/google/parsers/storage/get_bucket_object_versions.rb similarity index 97% rename from lib/fog/parsers/storage/google/get_bucket_object_versions.rb rename to lib/fog/google/parsers/storage/get_bucket_object_versions.rb index 298b792aec..f304e0708d 100644 --- a/lib/fog/parsers/storage/google/get_bucket_object_versions.rb +++ b/lib/fog/google/parsers/storage/get_bucket_object_versions.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class GetBucketObjectVersions < Fog::Parsers::Base def reset @delete_marker = { "Owner" => {} } diff --git a/lib/fog/parsers/storage/google/get_bucket_versioning.rb b/lib/fog/google/parsers/storage/get_bucket_versioning.rb similarity index 87% rename from lib/fog/parsers/storage/google/get_bucket_versioning.rb rename to lib/fog/google/parsers/storage/get_bucket_versioning.rb index 63f3aaa152..9ca6b77a67 100644 --- a/lib/fog/parsers/storage/google/get_bucket_versioning.rb +++ b/lib/fog/google/parsers/storage/get_bucket_versioning.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class GetBucketVersioning < Fog::Parsers::Base def reset @response = { "VersioningConfiguration" => {} } diff --git a/lib/fog/parsers/storage/google/get_request_payment.rb b/lib/fog/google/parsers/storage/get_request_payment.rb similarity index 81% rename from lib/fog/parsers/storage/google/get_request_payment.rb rename to lib/fog/google/parsers/storage/get_request_payment.rb index de0aae0f8f..640b29e6b4 100644 --- a/lib/fog/parsers/storage/google/get_request_payment.rb +++ b/lib/fog/google/parsers/storage/get_request_payment.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class GetRequestPayment < Fog::Parsers::Base def end_element(name) case name diff --git a/lib/fog/parsers/storage/google/get_service.rb b/lib/fog/google/parsers/storage/get_service.rb similarity index 91% rename from lib/fog/parsers/storage/google/get_service.rb rename to lib/fog/google/parsers/storage/get_service.rb index 86c9d5d2de..8efedf3a35 100644 --- a/lib/fog/parsers/storage/google/get_service.rb +++ b/lib/fog/google/parsers/storage/get_service.rb @@ -1,7 +1,7 @@ module Fog - module Parsers - module Storage - module Google + module Google + module Parsers + module Storage class GetService < Fog::Parsers::Base def reset @bucket = {} diff --git a/lib/fog/google/parsers/storage/storage.rb b/lib/fog/google/parsers/storage/storage.rb new file mode 100644 index 0000000000..4b10147ceb --- /dev/null +++ b/lib/fog/google/parsers/storage/storage.rb @@ -0,0 +1,15 @@ +module Fog + module Google + module Parsers + module Storage + autoload :AccessControlList, 'fog/google/parsers/storage/access_control_list' + autoload :CopyObject, 'fog/google/parsers/storage/copy_object' + autoload :GetBucket, 'fog/google/parsers/storage/get_bucket' + autoload :GetBucketLogging, 'fog/google/parsers/storage/get_bucket_logging' + autoload :GetBucketObjectVersions, 'fog/google/parsers/storage/get_bucket_object_versions' + autoload :GetRequestPayment, 'fog/google/parsers/storage/get_request_payment' + autoload :GetService, 'fog/google/parsers/storage/get_service' + end + end + end +end diff --git a/lib/fog/google/storage/storage_xml/requests/copy_object.rb b/lib/fog/google/storage/storage_xml/requests/copy_object.rb index f7b9d9e9cd..7fa8a60524 100644 --- a/lib/fog/google/storage/storage_xml/requests/copy_object.rb +++ b/lib/fog/google/storage/storage_xml/requests/copy_object.rb @@ -28,7 +28,7 @@ def copy_object(source_bucket_name, source_object_name, target_bucket_name, targ :headers => headers, :host => "#{target_bucket_name}.#{@host}", :method => "PUT", - :parser => Fog::Parsers::Storage::Google::CopyObject.new, + :parser => Fog::Google::Parsers::Storage::CopyObject.new, :path => Fog::Google.escape(target_object_name)) end end diff --git a/lib/fog/google/storage/storage_xml/requests/get_bucket.rb b/lib/fog/google/storage/storage_xml/requests/get_bucket.rb index 18a2db6a9f..5705c91a79 100644 --- a/lib/fog/google/storage/storage_xml/requests/get_bucket.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_bucket.rb @@ -41,7 +41,7 @@ def get_bucket(bucket_name, options = {}) :host => "#{bucket_name}.#{@host}", :idempotent => true, :method => "GET", - :parser => Fog::Parsers::Storage::Google::GetBucket.new, + :parser => Fog::Google::Parsers::Storage::GetBucket.new, :query => options) end end diff --git a/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb b/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb index 9c1bc7bf8a..d46d01c90a 100644 --- a/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb @@ -30,7 +30,7 @@ def get_bucket_acl(bucket_name) :host => "#{bucket_name}.#{@host}", :idempotent => true, :method => "GET", - :parser => Fog::Parsers::Storage::Google::AccessControlList.new, + :parser => Fog::Google::Parsers::Storage::AccessControlList.new, :query => { "acl" => nil }) end end diff --git a/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb b/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb index 04563521d2..e67cdee122 100644 --- a/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_object_acl.rb @@ -38,7 +38,7 @@ def get_object_acl(bucket_name, object_name, options = {}) :host => "#{bucket_name}.#{@host}", :idempotent => true, :method => "GET", - :parser => Fog::Parsers::Storage::Google::AccessControlList.new, + :parser => Fog::Google::Parsers::Storage::AccessControlList.new, :path => Fog::Google.escape(object_name), :query => query) end diff --git a/lib/fog/google/storage/storage_xml/requests/get_service.rb b/lib/fog/google/storage/storage_xml/requests/get_service.rb index 7151041eb5..14c7ba1f55 100644 --- a/lib/fog/google/storage/storage_xml/requests/get_service.rb +++ b/lib/fog/google/storage/storage_xml/requests/get_service.rb @@ -19,7 +19,7 @@ def get_service :host => @host, :idempotent => true, :method => "GET", - :parser => Fog::Parsers::Storage::Google::GetService.new) + :parser => Fog::Google::Parsers::Storage::GetService.new) end end diff --git a/lib/fog/parsers/storage/google.rb b/lib/fog/parsers/storage/google.rb deleted file mode 100644 index 455c8b6188..0000000000 --- a/lib/fog/parsers/storage/google.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Fog - module Parsers - module Storage - module Google - autoload :AccessControlList, File.expand_path("../google/access_control_list", __FILE__) - autoload :CopyObject, File.expand_path("../google/copy_object", __FILE__) - autoload :GetBucket, File.expand_path("../google/get_bucket", __FILE__) - autoload :GetBucketLogging, File.expand_path("../google/get_bucket_logging", __FILE__) - autoload :GetBucketObjectVersions, File.expand_path("../google/get_bucket_object_versions", __FILE__) - autoload :GetRequestPayment, File.expand_path("../google/get_request_payment", __FILE__) - autoload :GetService, File.expand_path("../google/get_service", __FILE__) - end - end - end -end From 0ff179e10362132f49aa59c450105ea351998a91 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 19:03:34 +1000 Subject: [PATCH 06/46] Autoload: consistent use of library path --- lib/fog/google.rb | 10 +++++----- lib/fog/google/monitoring.rb | 4 ++-- lib/fog/google/pubsub.rb | 4 ++-- lib/fog/google/sql.rb | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/fog/google.rb b/lib/fog/google.rb index 82b55c5c04..7bb33c01f6 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -7,11 +7,11 @@ module Fog module Google autoload :Compute, 'fog/google/compute/compute' autoload :DNS, 'fog/google/dns/dns' - autoload :Mock, File.expand_path("../google/mock", __FILE__) - autoload :Monitoring, File.expand_path("../google/monitoring", __FILE__) - autoload :Pubsub, File.expand_path("../google/pubsub", __FILE__) - autoload :Shared, File.expand_path("../google/shared", __FILE__) - autoload :SQL, File.expand_path("../google/sql", __FILE__) + autoload :Mock, 'fog/google/mock' + autoload :Monitoring, 'fog/google/monitoring' + autoload :Pubsub, 'fog/google/pubsub' + autoload :Shared, 'fog/google/shared' + autoload :SQL, 'fog/google/sql' autoload :Storage, 'fog/google/storage/storage' autoload :StorageJSON, 'fog/google/storage/storage_json' autoload :StorageXML, 'fog/google/storage/storage_xml' diff --git a/lib/fog/google/monitoring.rb b/lib/fog/google/monitoring.rb index 93af09c560..d4b8820b75 100644 --- a/lib/fog/google/monitoring.rb +++ b/lib/fog/google/monitoring.rb @@ -1,8 +1,8 @@ module Fog module Google class Monitoring < Fog::Service - autoload :Mock, File.expand_path("../monitoring/mock", __FILE__) - autoload :Real, File.expand_path("../monitoring/real", __FILE__) + autoload :Mock, 'fog/google/monitoring/mock' + autoload :Real, 'fog/google/monitoring/real' requires :google_project recognizes( diff --git a/lib/fog/google/pubsub.rb b/lib/fog/google/pubsub.rb index 30e50b40fc..18aa1e151a 100644 --- a/lib/fog/google/pubsub.rb +++ b/lib/fog/google/pubsub.rb @@ -1,8 +1,8 @@ module Fog module Google class Pubsub < Fog::Service - autoload :Mock, File.expand_path("../pubsub/mock", __FILE__) - autoload :Real, File.expand_path("../pubsub/real", __FILE__) + autoload :Mock, 'fog/google/pubsub/mock' + autoload :Real, 'fog/google/pubsub/real' requires :google_project recognizes( diff --git a/lib/fog/google/sql.rb b/lib/fog/google/sql.rb index bfa7fd9bc6..db262b7ce2 100644 --- a/lib/fog/google/sql.rb +++ b/lib/fog/google/sql.rb @@ -1,8 +1,8 @@ module Fog module Google class SQL < Fog::Service - autoload :Mock, File.expand_path("../sql/mock", __FILE__) - autoload :Real, File.expand_path("../sql/real", __FILE__) + autoload :Mock, 'fog/google/sql/mock' + autoload :Real, 'fog/google/sql/real' requires :google_project recognizes( From 1e793df7f39eaeb5d83ba481caf978c964e6d718 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 19:15:26 +1000 Subject: [PATCH 07/46] Restore CHANGELOG, CONTRIBUTING and fix missing change in README --- CHANGELOG.md | 48 ++++++++++++++++++++++++------------------------ CONTRIBUTING.md | 2 +- README.md | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 794f720543..8b59c64bda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Fixed -- \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url` +- \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url` request ## 1.7.0 @@ -70,17 +70,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Added - \#409 Support query parameters in `Fog::Storage::Google` GET requests [stanhu] -- \#394 Add some helper methods to `Fog::Google::Compute::Server` [temikus] +- \#394 Add some helper methods to `Fog::Compute::Google::Server` [temikus] - `.private_ip_address` - `.stopped?` - \#375 Add timeout options to `Fog::Storage::GoogleJSON` client [dosuken123] #### Changed -- \#394 `save/update/destroy` and other operations now wait until they are in a - DONE state, instead of !PENDING. This should be a no-op for users but should +- \#394 `save/update/destroy` and other operations now wait until they are in a + DONE state, instead of !PENDING. This should be a no-op for users but should safeguard from issues in the future. [temikus] -- \#383 `Fog::Google::Compute::Address` resources are now created synchronously +- \#383 `Fog::Compute::Google::Address` resources are now created synchronously by default. [temikus] ### Development changes @@ -96,7 +96,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html - \#376 Add doc coverage tracking. [temikus] - \#383 Increase integration test coverage further. [temikus] - Add collection tests and factories (when mutable) for following resources: - - Addresses + - Addresses - Disks - Projects - Routes @@ -120,23 +120,23 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html #### Changed -- \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default. +- \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default. You can override it in a standard manner by passing a parameter to async method, e.g.: `Fog::Google::SQL::Instance.create(true)` [temikus] -- \#367 `Fog::Google::Compute::Server.bootstrap` changes [temikus] +- \#367 `Fog::Compute::Google::Server.bootstrap` changes [temikus] - Now creates instances with disks that automatically delete on instance shutdown. - Now creates instances with a public IP address by default. #### Added -- \#361 `Fog::Google::Compute::Server` now recognises `network_ip` attribute to specify internal IP. [mattimatti] +- \#361 `Fog::Compute::Google::Server` now recognises `network_ip` attribute to specify internal IP. [mattimatti] #### Fixed - \#338 Fixed SQL Users model workflow [temikus] - \#359 Fix whitespace escaping in XML Storage methods [temikus] - \#366 Fixing `Server` model to properly accept `:private_key_path` and `:public_key_path` attributes again. [temikus] -- \#367 `Fog::Google::Compute::Server.bootstrap` parameters are now properly merged with default ones. [tesmikus] +- \#367 `Fog::Compute::Google::Server.bootstrap` parameters are now properly merged with default ones. [tesmikus] ### Development changes @@ -155,7 +155,7 @@ You can override it in a standard manner by passing a parameter to async method, - \#348 Added Instance Group Manager and Instance Templates [bpaquet] - - `Fog::Google::Compute::InstanceGroupManager` model and associated requests: + - `Fog::Compute::Google::InstanceGroupManager` model and associated requests: - `:get_instance_group_manager` - `:insert_instance_group_manager` - `:delete_instance_group_manager` @@ -164,7 +164,7 @@ You can override it in a standard manner by passing a parameter to async method, - `:recreate_instances` - `:abandon_instances` - - `Fog::Google::Compute::InstanceTemplate` model and associated requests: + - `Fog::Compute::Google::InstanceTemplate` model and associated requests: - `:list_instance_templates` - `:get_instance_template` - `:insert_instance_template` @@ -188,31 +188,31 @@ You can override it in a standard manner by passing a parameter to async method, #### Added -- \#336 `Fog::Google::Compute::Server.set_metadata` is now working properly and adopted a simpler format, e.g. `{'foo' => 'bar', 'baz'=>'foo'}` -- \#334 Added a new helper method: `Fog::Google::Compute::Server.public_ip_address` [temikus] -- \#314 Added `Fog::Google::Compute::InstanceGroup.add_instance` method back [temikus] +- \#336 `Fog::Compute::Google::Server.set_metadata` is now working properly and adopted a simpler format, e.g. `{'foo' => 'bar', 'baz'=>'foo'}` +- \#334 Added a new helper method: `Fog::Compute::Google::Server.public_ip_address` [temikus] +- \#314 Added `Fog::Compute::Google::InstanceGroup.add_instance` method back [temikus] - \#326 Added support for using predefined ACLs, refactor valid ACLs [vimutter] - \#318 Added fog_public support in Storage JSON API [jayhsu21] #### Fixed -- \#354 Bump Google API client to 0.23 [temikus] -- \#346 Fixed get_health when called with an instance name [bpaquet] -- \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus] -- \#321 Fix string key instead of symbol for subnetworks listing [tumido] -- \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter] +- \#354 Bump Google API client to 0.23 [temikus] +- \#346 Fixed get_health when called with an instance name [bpaquet] +- \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus] +- \#321 Fix string key instead of symbol for subnetworks listing [tumido] +- \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter] ### Development changes #### Added -- \#353 Added collection/model unit tests to be run by Travis CI [temikus] -- \#347 Added target pool tests [temikus] +- \#353 Added collection/model unit tests to be run by Travis CI [temikus] +- \#347 Added target pool tests [temikus] #### Fixed - \#322 Fixed all broken integration tests, all tests now pass in CI [temikus] -- \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus] +- \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus] ## 1.0.1 @@ -274,4 +274,4 @@ We encourage people using 0.5.1 to upgrade. #### Added -#### Fixed +#### Fixed \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 406e57b11c..a7f98956b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ $ inch Or view suggestions on a specific method: ``` -$ inch show Fog::Google::Compute::Server#set_metadata +$ inch show Fog::Compute::Google::Server#set_metadata ``` ### Testing diff --git a/README.md b/README.md index 00c4f3eed7..3e9d5eb919 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ See **[MIGRATING.md](MIGRATING.md)** for migration between major versions. ## Storage -There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Storage::Google` will automatically direct you to the appropriate API based on the credentials you provide it. +There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Google::Storage` will automatically direct you to the appropriate API based on the credentials you provide it. * The [XML API](https://cloud.google.com/storage/docs/xml-api-overview/) is almost identical to S3. Use [Google's interoperability keys](https://cloud.google.com/storage/docs/migrating#keys) to access it. * The new [JSON API](https://cloud.google.com/storage/docs/json_api/) is faster and uses auth similarly to the rest of the Google Cloud APIs using a [service account private key](https://developers.google.com/identity/protocols/OAuth2ServiceAccount). From 0b13ab8593963382b25de3d68e1a44a1a2d9ef71 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Thu, 20 Sep 2018 19:19:23 +1000 Subject: [PATCH 08/46] Autoload: Use double quotes --- lib/fog/google.rb | 22 +++++++++++----------- lib/fog/google/compute/compute.rb | 4 ++-- lib/fog/google/dns/dns.rb | 4 ++-- lib/fog/google/monitoring.rb | 4 ++-- lib/fog/google/parsers/storage/storage.rb | 14 +++++++------- lib/fog/google/pubsub.rb | 4 ++-- lib/fog/google/sql.rb | 4 ++-- lib/fog/google/storage/storage_json.rb | 6 +++--- lib/fog/google/storage/storage_xml.rb | 6 +++--- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/fog/google.rb b/lib/fog/google.rb index 7bb33c01f6..4521266cd2 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -5,16 +5,16 @@ module Fog module Google - autoload :Compute, 'fog/google/compute/compute' - autoload :DNS, 'fog/google/dns/dns' - autoload :Mock, 'fog/google/mock' - autoload :Monitoring, 'fog/google/monitoring' - autoload :Pubsub, 'fog/google/pubsub' - autoload :Shared, 'fog/google/shared' - autoload :SQL, 'fog/google/sql' - autoload :Storage, 'fog/google/storage/storage' - autoload :StorageJSON, 'fog/google/storage/storage_json' - autoload :StorageXML, 'fog/google/storage/storage_xml' + autoload :Compute, "fog/google/compute/compute" + autoload :DNS, "fog/google/dns/dns" + autoload :Mock, "fog/google/mock" + autoload :Monitoring, "fog/google/monitoring" + autoload :Pubsub, "fog/google/pubsub" + autoload :Shared, "fog/google/shared" + autoload :SQL, "fog/google/sql" + autoload :Storage, "fog/google/storage/storage" + autoload :StorageJSON, "fog/google/storage/storage_json" + autoload :StorageXML, "fog/google/storage/storage_xml" extend Fog::Provider @@ -36,7 +36,7 @@ def self.escape(str, extra_exclude_chars = "") end module Parsers - autoload :Storage, 'fog/google/parsers/storage/storage' + autoload :Storage, "fog/google/parsers/storage/storage" end end end diff --git a/lib/fog/google/compute/compute.rb b/lib/fog/google/compute/compute.rb index 3b7d1fc141..97f06e7ecd 100644 --- a/lib/fog/google/compute/compute.rb +++ b/lib/fog/google/compute/compute.rb @@ -1,8 +1,8 @@ module Fog module Google class Compute < Fog::Service - autoload :Mock, 'fog/google/compute/mock' - autoload :Real, 'fog/google/compute/real' + autoload :Mock, "fog/google/compute/mock" + autoload :Real, "fog/google/compute/real" requires :google_project recognizes( diff --git a/lib/fog/google/dns/dns.rb b/lib/fog/google/dns/dns.rb index db66edd5aa..a02cdbde04 100644 --- a/lib/fog/google/dns/dns.rb +++ b/lib/fog/google/dns/dns.rb @@ -1,8 +1,8 @@ module Fog module Google class DNS < Fog::Service - autoload :Mock, 'fog/google/dns/mock' - autoload :Real, 'fog/google/dns/real' + autoload :Mock, "fog/google/dns/mock" + autoload :Real, "fog/google/dns/real" requires :google_project recognizes( diff --git a/lib/fog/google/monitoring.rb b/lib/fog/google/monitoring.rb index d4b8820b75..5d12df2c73 100644 --- a/lib/fog/google/monitoring.rb +++ b/lib/fog/google/monitoring.rb @@ -1,8 +1,8 @@ module Fog module Google class Monitoring < Fog::Service - autoload :Mock, 'fog/google/monitoring/mock' - autoload :Real, 'fog/google/monitoring/real' + autoload :Mock, "fog/google/monitoring/mock" + autoload :Real, "fog/google/monitoring/real" requires :google_project recognizes( diff --git a/lib/fog/google/parsers/storage/storage.rb b/lib/fog/google/parsers/storage/storage.rb index 4b10147ceb..d275ef1410 100644 --- a/lib/fog/google/parsers/storage/storage.rb +++ b/lib/fog/google/parsers/storage/storage.rb @@ -2,13 +2,13 @@ module Fog module Google module Parsers module Storage - autoload :AccessControlList, 'fog/google/parsers/storage/access_control_list' - autoload :CopyObject, 'fog/google/parsers/storage/copy_object' - autoload :GetBucket, 'fog/google/parsers/storage/get_bucket' - autoload :GetBucketLogging, 'fog/google/parsers/storage/get_bucket_logging' - autoload :GetBucketObjectVersions, 'fog/google/parsers/storage/get_bucket_object_versions' - autoload :GetRequestPayment, 'fog/google/parsers/storage/get_request_payment' - autoload :GetService, 'fog/google/parsers/storage/get_service' + autoload :AccessControlList, "fog/google/parsers/storage/access_control_list" + autoload :CopyObject, "fog/google/parsers/storage/copy_object" + autoload :GetBucket, "fog/google/parsers/storage/get_bucket" + autoload :GetBucketLogging, "fog/google/parsers/storage/get_bucket_logging" + autoload :GetBucketObjectVersions, "fog/google/parsers/storage/get_bucket_object_versions" + autoload :GetRequestPayment, "fog/google/parsers/storage/get_request_payment" + autoload :GetService, "fog/google/parsers/storage/get_service" end end end diff --git a/lib/fog/google/pubsub.rb b/lib/fog/google/pubsub.rb index 18aa1e151a..29f5d6ea1b 100644 --- a/lib/fog/google/pubsub.rb +++ b/lib/fog/google/pubsub.rb @@ -1,8 +1,8 @@ module Fog module Google class Pubsub < Fog::Service - autoload :Mock, 'fog/google/pubsub/mock' - autoload :Real, 'fog/google/pubsub/real' + autoload :Mock, "fog/google/pubsub/mock" + autoload :Real, "fog/google/pubsub/real" requires :google_project recognizes( diff --git a/lib/fog/google/sql.rb b/lib/fog/google/sql.rb index db262b7ce2..128d2ddd6a 100644 --- a/lib/fog/google/sql.rb +++ b/lib/fog/google/sql.rb @@ -1,8 +1,8 @@ module Fog module Google class SQL < Fog::Service - autoload :Mock, 'fog/google/sql/mock' - autoload :Real, 'fog/google/sql/real' + autoload :Mock, "fog/google/sql/mock" + autoload :Real, "fog/google/sql/real" requires :google_project recognizes( diff --git a/lib/fog/google/storage/storage_json.rb b/lib/fog/google/storage/storage_json.rb index bc5d59d0a3..82909d7785 100644 --- a/lib/fog/google/storage/storage_json.rb +++ b/lib/fog/google/storage/storage_json.rb @@ -1,9 +1,9 @@ module Fog module Google class StorageJSON < Fog::Service - autoload :Mock, 'fog/google/storage/storage_json/mock' - autoload :Real, 'fog/google/storage/storage_json/real' - autoload :Utils, 'fog/google/storage/storage_json/utils' + autoload :Mock, "fog/google/storage/storage_json/mock" + autoload :Real, "fog/google/storage/storage_json/real" + autoload :Utils, "fog/google/storage/storage_json/utils" requires :google_project recognizes( diff --git a/lib/fog/google/storage/storage_xml.rb b/lib/fog/google/storage/storage_xml.rb index 31660bc7be..3a24e74b0e 100644 --- a/lib/fog/google/storage/storage_xml.rb +++ b/lib/fog/google/storage/storage_xml.rb @@ -1,9 +1,9 @@ module Fog module Google class StorageXML < Fog::Service - autoload :Mock, 'fog/google/storage/storage_xml/mock' - autoload :Real, 'fog/google/storage/storage_xml/real' - autoload :Utils, 'fog/google/storage/storage_xml/utils' + autoload :Mock, "fog/google/storage/storage_xml/mock" + autoload :Real, "fog/google/storage/storage_xml/real" + autoload :Utils, "fog/google/storage/storage_xml/utils" requires :google_storage_access_key_id, :google_storage_secret_access_key recognizes :host, :port, :scheme, :persistent, :path_style From 91d7dc3af1e7b8893bebdac697f37e3598c662e0 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Fri, 28 Sep 2018 10:06:03 +1000 Subject: [PATCH 09/46] fog-core: Use ~> Major.Minor is better practice --- fog-google.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fog-google.gemspec b/fog-google.gemspec index 954ab238b1..82d32bb9b9 100644 --- a/fog-google.gemspec +++ b/fog-google.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = "~> 2.0" # Locked until https://github.com/fog/fog-google/issues/417 is resolved - spec.add_dependency "fog-core", "~> 2.1.2" + spec.add_dependency "fog-core", "~> 2.1" spec.add_dependency "fog-json", "~> 1.2.0" spec.add_dependency "fog-xml", "~> 0.1.0" From 600ba592819e8ae9ec290894a1de1df8c2bae9d7 Mon Sep 17 00:00:00 2001 From: Gilles Dubreuil Date: Fri, 28 Sep 2018 19:22:05 +1000 Subject: [PATCH 10/46] Fix after rebase --- test/unit/dns/test_common_collections.rb | 5 ++--- test/unit/storage/test_common_json_collections.rb | 5 ++--- test/unit/storage/test_common_xml_collections.rb | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/unit/dns/test_common_collections.rb b/test/unit/dns/test_common_collections.rb index 7a1848bdf8..c076f41495 100644 --- a/test/unit/dns/test_common_collections.rb +++ b/test/unit/dns/test_common_collections.rb @@ -3,13 +3,12 @@ class UnitTestDNSCollections < MiniTest::Test def setup Fog.mock! - @client = Fog::DNS.new(provider: "google", - google_project: "foo") + @client = Fog::Google::DNS.new(google_project: "foo") # Exceptions that do not pass test_common_methods: # # DNS Projects API does not support 'list', so 'all' method is not possible - @common_methods_exceptions = [Fog::DNS::Google::Projects] + @common_methods_exceptions = [Fog::Google::DNS::Projects] # Enumerate all descendants of Fog::Collection descendants = ObjectSpace.each_object(Fog::Collection.singleton_class) diff --git a/test/unit/storage/test_common_json_collections.rb b/test/unit/storage/test_common_json_collections.rb index 54ed074add..eb9adcdea4 100644 --- a/test/unit/storage/test_common_json_collections.rb +++ b/test/unit/storage/test_common_json_collections.rb @@ -3,14 +3,13 @@ class UnitTestStorageJSONCollections < MiniTest::Test def setup Fog.mock! - @client = Fog::Storage.new(provider: "google", - google_project: "foo") + @client = Fog::Google::Storage.new(google_project: "foo") # Enumerate all descendants of Fog::Collection descendants = ObjectSpace.each_object(Fog::Collection.singleton_class) @collections = descendants.select do |d| - d.name.match(/Fog::Storage::GoogleJSON/) + d.name.match(/Fog::Google::StorageJSON/) end end diff --git a/test/unit/storage/test_common_xml_collections.rb b/test/unit/storage/test_common_xml_collections.rb index 60bc88ba12..0f2da219b6 100644 --- a/test/unit/storage/test_common_xml_collections.rb +++ b/test/unit/storage/test_common_xml_collections.rb @@ -3,15 +3,14 @@ class UnitTestStorageXMLCollections < MiniTest::Test def setup Fog.mock! - @client = Fog::Storage.new(provider: "google", - google_storage_access_key_id: "", + @client = Fog::Google::Storage.new(google_storage_access_key_id: "", google_storage_secret_access_key: "") # Enumerate all descendants of Fog::Collection descendants = ObjectSpace.each_object(Fog::Collection.singleton_class) @collections = descendants.select do |d| - d.name.match(/Fog::Storage::GoogleXML/) + d.name.match(/Fog::Google::StorageXML/) end end From 952a9dae004e3bd4e7d5d844b3b23ba69637a7f4 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Arimbrathodiyil Date: Tue, 20 Nov 2018 15:33:31 +0530 Subject: [PATCH 11/46] relax fog-json constraint it follows SemVer https://github.com/fog/fog-json#versioning --- fog-google.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fog-google.gemspec b/fog-google.gemspec index 42d4fa2432..1e2bbb9947 100644 --- a/fog-google.gemspec +++ b/fog-google.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| # Locked until https://github.com/fog/fog-google/issues/417 is resolved spec.add_dependency "fog-core", "<= 2.1.0" - spec.add_dependency "fog-json", "~> 1.2.0" + spec.add_dependency "fog-json", "~> 1.2" spec.add_dependency "fog-xml", "~> 0.1.0" # Hard Requirement as of 1.0 From 87ad75769c0dffa1033fc22c627f00305ccbb3a8 Mon Sep 17 00:00:00 2001 From: itopalov Date: Wed, 21 Nov 2018 13:09:51 +0000 Subject: [PATCH 12/46] Allow the api to close Tempfiles inline Allows the the gem to clean up temporary files at execution time rather than relying on the Garbage Collector to clean up or other parts of the MRI calling the object space finalize methods. --- lib/fog/storage/google_json/requests/get_object.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fog/storage/google_json/requests/get_object.rb b/lib/fog/storage/google_json/requests/get_object.rb index d0659a2ee7..25bfad0771 100644 --- a/lib/fog/storage/google_json/requests/get_object.rb +++ b/lib/fog/storage/google_json/requests/get_object.rb @@ -68,6 +68,8 @@ def get_object(bucket_name, object_name, end object + ensure + buf.close! rescue nil end end From 5cd625f032ebd589e749152912032f6e47081dbd Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 15 Oct 2018 17:34:27 +1100 Subject: [PATCH 13/46] Do not load pry_byebug on JRuby --- Gemfile | 3 +++ fog-google.gemspec | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 661c969cd2..6280927b1f 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,8 @@ gem "inch", :require => false gem "osrcry", :require => false gem "rubocop", :require => false +# Debugger is specified here as it's not compatible with jRuby +gem "pry-byebug", :platforms => :ruby + # Specify your gem's dependencies in fog-google.gemspec gemspec diff --git a/fog-google.gemspec b/fog-google.gemspec index 1e2bbb9947..3d3c141428 100644 --- a/fog-google.gemspec +++ b/fog-google.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| # Debugger spec.add_development_dependency "pry" - spec.add_development_dependency "pry-byebug" # Testing gems spec.add_development_dependency "retriable" From 25e3bde029871a37b1cb39726c5921477a94c5d1 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 25 Oct 2018 10:14:16 +1100 Subject: [PATCH 14/46] Add JRuby 9.1 to Travis --- .travis.yml | 1 + CHANGELOG.md | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index da225d3415..2da87fd060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ matrix: - rvm: 2.3 - rvm: 2.4 - rvm: 2.5 + - rvm: jruby-9.1 - rvm: jruby-head allow_failures: - rvm: jruby-head diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b59c64bda..ba107a3c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1 This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## Next + +### Development changes + +#### Fixed + +- \#425 Fix bundling in development environment on JRuby [temikus] + - Adding JRuby 9.1 into Travis + ## 1.8.1 ### User-facing From 3a4f095558034d905692b510184558737fa68161 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Mon, 10 Dec 2018 18:06:13 +1100 Subject: [PATCH 15/46] Add documentation to attached disk helper methods --- lib/fog/compute/google/models/disk.rb | 31 +++++++++++++++++++++++++- lib/fog/compute/google/models/disks.rb | 28 +++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/google/models/disk.rb b/lib/fog/compute/google/models/disk.rb index f00df2be33..ffe839b0d8 100644 --- a/lib/fog/compute/google/models/disk.rb +++ b/lib/fog/compute/google/models/disk.rb @@ -67,7 +67,36 @@ def destroy(async = true) def zone_name zone.nil? ? nil : zone.split("/")[-1] end - + + # Returns an attached disk configuration hash. + # + # Compute API needs attached disks to be specified in a custom format. + # This provides a handy shortcut for generating a preformatted config. + # + # Example output: + # {:auto_delete=>false, + # :boot=>true, + # :mode=>"READ_WRITE", + # :source=>"https://www.googleapis.com/compute/v1/projects/myproj/zones/us-central1-f/disks/mydisk", + # :type=>"PERSISTENT"} + # + # See Instances.insert API docs for more info: + # https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert + # + # @param [Hash] opts options to attach the disk with. + # @option opts [Boolean] :writable The mode in which to attach this + # disk. (defaults to READ_WRITE) + # @option opts [Boolean] :boot Indicates whether this is a boot disk. + # (defaults to false) + # @option opts [String] :device_name Specifies a unique device name + # of your choice that is reflected into the /dev/disk/by-id/google-* + # tree of a Linux operating system running within the instance. + # @option opts [Object] :encryption_key Encrypts or decrypts a disk + # using a customer-supplied encryption key. + # @option opts [Object] :auto_delete Specifies whether the disk will + # be auto-deleted when the instance is deleted. (defaults to false) + # + # @return [Hash] Attached disk configuration hash def attached_disk_obj(opts = {}) requires :self_link collection.attached_disk_obj(self_link, opts) diff --git a/lib/fog/compute/google/models/disks.rb b/lib/fog/compute/google/models/disks.rb index d7fe166e88..e5ee2e2bf2 100644 --- a/lib/fog/compute/google/models/disks.rb +++ b/lib/fog/compute/google/models/disks.rb @@ -38,6 +38,34 @@ def get(identity, zone = nil) nil end + # Returns an attached disk configuration hash. + # + # Compute API needs attached disks to be specified in a custom format. + # This provides a handy shortcut for generating a preformatted config. + # + # Example output: + # {:auto_delete=>false, + # :boot=>true, + # :mode=>"READ_WRITE", + # :source=>"https://www.googleapis.com/compute/v1/projects/myproj/zones/us-central1-f/disks/mydisk", + # :type=>"PERSISTENT"} + # + # See Instances.insert API docs for more info: + # https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert + # + # @param [String] source self_link of an existing disk resource + # @param [Boolean] writable The mode in which to attach this disk. + # (defaults to READ_WRITE) + # @param [Boolean] boot Indicates whether this is a boot disk. + # (defaults to false) + # @param [String] device_name Specifies a unique device name of your + # choice that is reflected into the /dev/disk/by-id/google-* tree of + # a Linux operating system running within the instance. + # @param [Object] encryption_key Encrypts or decrypts a disk using + # a customer-supplied encryption key. + # @param [Object] auto_delete Specifies whether the disk will be + # auto-deleted when the instance is deleted. (defaults to false) + # @return [Hash] def attached_disk_obj(source, writable: true, boot: false, From 1279881a7af8dfc7f0f3a37e2ccdbf53cbb3f1dc Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Mon, 10 Dec 2018 18:08:30 +1100 Subject: [PATCH 16/46] Add tests for attached disk objects --- .../compute/core_compute/test_disks.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/integration/compute/core_compute/test_disks.rb b/test/integration/compute/core_compute/test_disks.rb index 44ab0d6abe..9a59f6ee82 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -8,4 +8,25 @@ def setup @subject = Fog::Compute[:google].disks @factory = DisksFactory.new(namespaced_name) end + + def test_get_as_configs + disk = @factory.create + disk.wait_for { ready? } + + example = disk.get_as_boot_disk + config = { :auto_delete=>false, + :boot=>true, + :source=>disk.self_link, + :mode=>"READ_WRITE", + :type=>"PERSISTENT" } + assert_equal(example, config) + + example_with_params = disk.get_as_boot_disk(false, true) + config_with_params = { :auto_delete=>true, + :boot=>true, + :source=>disk.self_link, + :mode=>"READ_ONLY", + :type=>"PERSISTENT" } + assert_equal(example_with_params, config_with_params) + end end From 11c6d4a11a6819a4ea853c41ab9de0b3df27c2f4 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Mon, 10 Dec 2018 18:29:24 +1100 Subject: [PATCH 17/46] Consolidate logic of Disk.get_as_boot_disk Consolidates attached disk config logic in Compute::Google::Disk.get_as_boot_disk to reuse code from the collection Disks.attached_disk_obj method. --- lib/fog/compute/google/models/disk.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/fog/compute/google/models/disk.rb b/lib/fog/compute/google/models/disk.rb index ffe839b0d8..adf76e8f2b 100644 --- a/lib/fog/compute/google/models/disk.rb +++ b/lib/fog/compute/google/models/disk.rb @@ -67,7 +67,7 @@ def destroy(async = true) def zone_name zone.nil? ? nil : zone.split("/")[-1] end - + # Returns an attached disk configuration hash. # # Compute API needs attached disks to be specified in a custom format. @@ -103,13 +103,9 @@ def attached_disk_obj(opts = {}) end def get_as_boot_disk(writable = true, auto_delete = false) - { - :auto_delete => auto_delete, - :boot => true, - :source => self_link, - :mode => writable ? "READ_WRITE" : "READ_ONLY", - :type => "PERSISTENT" - } + attached_disk_obj(boot:true, + writable: writable, + auto_delete: auto_delete) end def ready? From e5087a81a542cda75b8250b7a2c1143b00c694d8 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Mon, 10 Dec 2018 19:59:06 +1100 Subject: [PATCH 18/46] Add doc for get_as_boot_disk --- lib/fog/compute/google/models/disk.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/google/models/disk.rb b/lib/fog/compute/google/models/disk.rb index adf76e8f2b..098a66bc06 100644 --- a/lib/fog/compute/google/models/disk.rb +++ b/lib/fog/compute/google/models/disk.rb @@ -102,8 +102,15 @@ def attached_disk_obj(opts = {}) collection.attached_disk_obj(self_link, opts) end + # A legacy shorthand for attached_disk_obj + # + # @param [Object] writable The mode in which to attach this disk. + # (defaults to READ_WRITE) + # @param [Object] auto_delete Specifies whether the disk will be + # auto-deleted when the instance is deleted. (defaults to false) + # @return [Hash] def get_as_boot_disk(writable = true, auto_delete = false) - attached_disk_obj(boot:true, + attached_disk_obj(boot: true, writable: writable, auto_delete: auto_delete) end From 834d7e2f305734a067b9ab42109aef4b19c02c43 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Tue, 11 Dec 2018 11:26:52 +1100 Subject: [PATCH 19/46] Address linter --- lib/fog/compute/google/models/disk.rb | 2 +- .../compute/core_compute/test_disks.rb | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/fog/compute/google/models/disk.rb b/lib/fog/compute/google/models/disk.rb index 098a66bc06..6d0a552bc3 100644 --- a/lib/fog/compute/google/models/disk.rb +++ b/lib/fog/compute/google/models/disk.rb @@ -95,7 +95,7 @@ def zone_name # using a customer-supplied encryption key. # @option opts [Object] :auto_delete Specifies whether the disk will # be auto-deleted when the instance is deleted. (defaults to false) - # + # # @return [Hash] Attached disk configuration hash def attached_disk_obj(opts = {}) requires :self_link diff --git a/test/integration/compute/core_compute/test_disks.rb b/test/integration/compute/core_compute/test_disks.rb index 9a59f6ee82..cf6b71f82d 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -14,19 +14,19 @@ def test_get_as_configs disk.wait_for { ready? } example = disk.get_as_boot_disk - config = { :auto_delete=>false, - :boot=>true, - :source=>disk.self_link, - :mode=>"READ_WRITE", - :type=>"PERSISTENT" } + config = { :auto_delete => false, + :boot => true, + :source => disk.self_link, + :mode => "READ_WRITE", + :type => "PERSISTENT" } assert_equal(example, config) example_with_params = disk.get_as_boot_disk(false, true) - config_with_params = { :auto_delete=>true, - :boot=>true, - :source=>disk.self_link, - :mode=>"READ_ONLY", - :type=>"PERSISTENT" } + config_with_params = { :auto_delete => true, + :boot => true, + :source => disk.self_link, + :mode => "READ_ONLY", + :type => "PERSISTENT" } assert_equal(example_with_params, config_with_params) end end From 46c2f0294384b7cb21b955aeec39a870148ba3cd Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 3 Jan 2019 16:07:20 +1100 Subject: [PATCH 20/46] Add a new example for attached non-boot disks --- .../create_instance_with_attached_disk.rb | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 examples/create_instance_with_attached_disk.rb diff --git a/examples/create_instance_with_attached_disk.rb b/examples/create_instance_with_attached_disk.rb new file mode 100644 index 0000000000..34c8e10250 --- /dev/null +++ b/examples/create_instance_with_attached_disk.rb @@ -0,0 +1,53 @@ +# All examples presume that you have a ~/.fog credentials file set up. +# More info on it can be found here: http://fog.io/about/getting_started.html + +require "bundler" +Bundler.require(:default, :development) + +def example + p "Connecting to Google API" + connection = Fog::Compute.new(:provider => "Google") + + p "Creating disk" + disk = connection.disks.create( + :name => "fog-smoke-test-#{Time.now.to_i}", + :size_gb => 10, + :zone => "us-central1-f", + :source_image => "debian-9-stretch-v20180611" + ) + + p "Creating a second disk" + attached_disk = connection.disks.create( + :name => "fog-smoke-test-#{Time.now.to_i}", + :size_gb => 10, + :zone => "us-central1-f" + ) + + p "Waiting for disks to be ready" + disk.wait_for { ready? } + attached_disk.wait_for { ready? } + + p "Creating a server" + server = connection.servers.create( + :name => "fog-smoke-test-#{Time.now.to_i}", + :disks => [disk.attached_disk_obj(boot: true), + attached_disk.attached_disk_obj(boot: false, + auto_delete: true)], + :machine_type => "n1-standard-1", + :private_key_path => File.expand_path("~/.ssh/id_rsa"), + :public_key_path => File.expand_path("~/.ssh/id_rsa.pub"), + :zone => "us-central1-f", + # Will be simplified, see https://github.com/fog/fog-google/issues/360 + :network_interfaces => [{ :network => "global/networks/default", + :access_configs => [{ + :name => "External NAT", + :type => "ONE_TO_ONE_NAT" + }] }], + :username => ENV["USER"] + ) + + p "Deleting server" + raise "Could not delete server." unless server.destroy +end + +example From 22b84ec77e65ed3bf08c2ea36fdc34d592c83a22 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 3 Jan 2019 16:49:08 +1100 Subject: [PATCH 21/46] Add a guard method for setting snapshot labels --- lib/fog/compute/google/models/snapshot.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/fog/compute/google/models/snapshot.rb b/lib/fog/compute/google/models/snapshot.rb index 95fed83062..80d99221b1 100644 --- a/lib/fog/compute/google/models/snapshot.rb +++ b/lib/fog/compute/google/models/snapshot.rb @@ -39,6 +39,12 @@ def destroy(async = true) def set_labels(new_labels) requires :identity, :label_fingerprint + + unless new_labels.is_a? Hash + raise ArgumentError, + "Labels should be a hash, e.g. {foo: \"bar\",fog: \"test\"}" + end + service.set_snapshot_labels(identity, label_fingerprint, new_labels) reload end From 5a68b15fcbdb4e8cba49c0511ec058c0b4cf6e2e Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 3 Jan 2019 16:49:32 +1100 Subject: [PATCH 22/46] Add an integration test for snapshots --- .../compute/core_compute/test_disks.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/integration/compute/core_compute/test_disks.rb b/test/integration/compute/core_compute/test_disks.rb index cf6b71f82d..ed47d8a8a5 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -29,4 +29,25 @@ def test_get_as_configs :type => "PERSISTENT" } assert_equal(example_with_params, config_with_params) end + + def test_create_snapshot + disk = @factory.create + disk.wait_for { ready? } + + snapshot = disk.create_snapshot("fog-test-snapshot") + + assert(snapshot.is_a?(Fog::Compute::Google::Snapshot), + "Resulting snapshot should be a snapshot object.") + + assert_raises(ArgumentError) { snapshot.set_labels(["bar", "test"]) } + + snapshot.set_labels(foo: "bar", fog: "test") + + assert_equal(snapshot.labels[:foo], "bar") + assert_equal(snapshot.labels[:fog], "test") + + # Clean up the snapshot + operation = snapshot.destroy + operation.wait_for { ready? } + end end From 9db334bbb6c24a91665f8faf95b793ec7bc3fc98 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 8 Jan 2019 12:22:29 +1100 Subject: [PATCH 23/46] Update CHANGELOG --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba107a3c10..8b99f2c85d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,23 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Next +### User-facing + +- \#435 Added additional examples for attached disks usage. [temikus] + ### Development changes #### Fixed -- \#425 Fix bundling in development environment on JRuby [temikus] +- \#425 Miscellaneous dev improvements around JRuby and disk handling [temikus] + - Fix bundling in development environment on JRuby - Adding JRuby 9.1 into Travis + - Consolidated logic of `Disk.get_as_boot_disk` and increase doc coverage of + disk-associated methods. + - Added integration tests for disk snapshots + a guard method for + `Snapshot.add_labels` + +- \#435 ## 1.8.1 From 9815ecbe11ee115d028940410a89fe75e297a353 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 8 Jan 2019 14:35:43 +1100 Subject: [PATCH 24/46] Remove EOL versions of ruby from Travis --- .travis.yml | 2 -- CHANGELOG.md | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2da87fd060..7ea57ae6d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ dist: trusty matrix: fast_finish: true include: - - rvm: 2.1 - - rvm: 2.2 - rvm: 2.3 - rvm: 2.4 - rvm: 2.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b99f2c85d..564f1a13cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html - \#425 Miscellaneous dev improvements around JRuby and disk handling [temikus] - Fix bundling in development environment on JRuby - Adding JRuby 9.1 into Travis + - Remove EOL versions of ruby from Travis - Consolidated logic of `Disk.get_as_boot_disk` and increase doc coverage of disk-associated methods. - Added integration tests for disk snapshots + a guard method for From 30f3441d3598e8667bb327ed3484277c2e90779c Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 23 Jan 2019 14:33:07 +1100 Subject: [PATCH 25/46] Update CHANGELOG --- CHANGELOG.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 564f1a13cb..193a07afe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,24 +6,37 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Next +## 1.8.2 + ### User-facing +#### Added + - \#435 Added additional examples for attached disks usage. [temikus] +#### Fixed + +- \#433 Allow the api to close Tempfiles inline, improving disk utilization. + [itopalov] + ### Development changes +#### Added + +- \#425 Integration on Jruby + disk snapshot tests: [temikus] + - Adding JRuby 9.1 into Travis + - Added integration tests for disk snapshots + #### Fixed -- \#425 Miscellaneous dev improvements around JRuby and disk handling [temikus] +- \#432 Relax fog-json constraint to minor version. [pravi] + +- \#425 Miscellaneous dev improvements around JRuby and disk handling: [temikus] - Fix bundling in development environment on JRuby - - Adding JRuby 9.1 into Travis - Remove EOL versions of ruby from Travis - Consolidated logic of `Disk.get_as_boot_disk` and increase doc coverage of disk-associated methods. - - Added integration tests for disk snapshots + a guard method for - `Snapshot.add_labels` - -- \#435 + - Add a guard a guard method for `Snapshot.add_labels` ## 1.8.1 From aa7f0845569b9e44b04816cdf240ec8ae47b5560 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 23 Jan 2019 14:33:16 +1100 Subject: [PATCH 26/46] Release 1.8.2 --- lib/fog/google/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/google/version.rb b/lib/fog/google/version.rb index 6e1b3d6387..be7ae8911a 100644 --- a/lib/fog/google/version.rb +++ b/lib/fog/google/version.rb @@ -1,5 +1,5 @@ module Fog module Google - VERSION = "1.8.1".freeze + VERSION = "1.8.2".freeze end end From 119cf98842e4005bf1bbe9f63e3ea1c88eb6f903 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Wed, 13 Mar 2019 11:40:25 +1100 Subject: [PATCH 27/46] Update to Concourse v4 - Concourse now requires all task parameters to be explicitly called out. - Updated readme a bit, removing obsolete Concourse setup instructions. (TF modules for our current setup will be published here soon) --- ci/README.md | 13 ++++++------- ci/tasks/run-int.yml | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/README.md b/ci/README.md index 5838fe527a..80a4386aa0 100644 --- a/ci/README.md +++ b/ci/README.md @@ -9,8 +9,6 @@ PR when the test completes. In order to run the fog-google Concourse Pipeline you must have an existing [Concourse](http://concourse.ci) environment. -See [Deploying Concourse on Google Compute Engine](https://github.com/cloudfoundry-incubator/bosh-google-cpi-release/blob/master/docs/concourse/README.md) -for instructions. To deploy the pipeline: @@ -28,13 +26,13 @@ file. See [Credentials Requirements](#credentials-requirements) for specific ins * Set the fog-google pipeline: ``` -fly -t fog-ci set-pipeline -p fog-google -c pipeline.yml -l credentials.yml +fly -t fog-ci set-pipeline -p pr-integration -c pipeline.yml -l credentials.yml ``` * Unpause the fog-google pipeline: ``` -fly -t fog-ci unpause-pipeline -p fog-google +fly -t fog-ci unpause-pipeline -p pr-integration ``` ## Credentials Requirements @@ -42,18 +40,19 @@ fly -t fog-ci unpause-pipeline -p fog-google Several external pieces of authentication are needed for credentials.yml 1. A JSON Service Account File for a service account with at least Editor access to the project. - * To get a Service Account File, see [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) + * To get a Service Account File, see [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) and create using the Project/Editor role. 1. A [Github Access Token](https://github.com/blog/1509-personal-api-tokens) with at least `repo:status` access and a private key with push access to the `fog/fog-google` repositoy. +1. A [Codecov.io](https://codecov.io/) token for tracking test coverage. + These items are equivalent to your login credentials for their resources. ## Login Gotchas -* If your Concourse deployment is using a self-signed certificate, use `--insecure` to -trust the provided certificate. +* Our concourse pipeline is using GitHub auth, providing access to manipulate the pipeline to the members of the [fog-google team](https://github.com/orgs/fog/teams/fog-google), managed through the OAuth application managed by [fog-google bot](https://github.com/fog-google-bot). * If logging into a specific team, ie `fog-google`, use `--team-name fog-google` to specify that. diff --git a/ci/tasks/run-int.yml b/ci/tasks/run-int.yml index 78e619aa1b..4ff3be26fe 100644 --- a/ci/tasks/run-int.yml +++ b/ci/tasks/run-int.yml @@ -10,6 +10,7 @@ run: path: src/fog-google/ci/tasks/run-int.sh params: rake_task: replace-me + codecov_token: replace-me google_project: replace-me google_client_email: replace-me google_json_key_data: | From de57e6ba8bbf1d08cc84ff86cc8cc88ffc38480f Mon Sep 17 00:00:00 2001 From: Ross Hattori Date: Mon, 18 Mar 2019 18:00:27 -0600 Subject: [PATCH 28/46] feat: Allow Google Application Default Credentials Previously, `fog-google` implicitly required a service account to authenticate against the Google Cloud Platform APIs. This change allows the use of Application Default Credentials so that end users can authenticate without a service account for development, testing, and one-off interactions. This change does not check any of the different environment variables that Google documents for its client libraries and instead reads a well-known file path for ADCs. --- lib/fog/google/shared.rb | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index e26d9704a5..c09dd50b35 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -78,6 +78,11 @@ def initialize_google_client(options) ::Google::Apis::ClientOptions.default.application_name = application_name ::Google::Apis::ClientOptions.default.application_version = Fog::Google::VERSION + if ENV["DEBUG"] + ::Google::Apis.logger = ::Logger.new(::STDERR) + ::Google::Apis.logger.level = ::Logger::DEBUG + end + auth = nil if options[:google_json_key_location] || options[:google_json_key_string] if options[:google_json_key_location] @@ -97,11 +102,6 @@ def initialize_google_client(options) raise ArgumentError.new("Missing required arguments: google_client_email") end - if ENV["DEBUG"] - ::Google::Apis.logger = ::Logger.new(::STDERR) - ::Google::Apis.logger.level = ::Logger::DEBUG - end - auth = ::Google::Auth::ServiceAccountCredentials.make_creds( :json_key_io => StringIO.new(json_key_hash.to_json), :scope => options[:google_api_scope_url] @@ -109,10 +109,17 @@ def initialize_google_client(options) elsif options[:google_auth] auth = options[:google_auth] else - raise ArgumentError.new( - "Missing required arguments: google_json_key_location, "\ - "google_json_key_string or google_auth" - ) + # fall back to Application Default Credentials before erroring + begin + auth = ::Google::Auth::DefaultCredentials.from_well_known_path( + options[:google_api_scope_url] + ) + rescue StandardError + raise ArgumentError.new( + "Application Default Credentials not found; Missing required " \ + "arguments: google_json_key_location, google_json_key_string or google_auth" + ) + end end ::Google::Apis::RequestOptions.default.authorization = auth From 9fe0b06e10f3b99b72da6b9a3823168ba14a817e Mon Sep 17 00:00:00 2001 From: Ross Hattori Date: Tue, 19 Mar 2019 18:30:19 -0600 Subject: [PATCH 29/46] fix: Use Google's convenience function for Application Default Credentials And don't mask errors with overzealous rescues. --- lib/fog/google/shared.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index c09dd50b35..7e0ff1e119 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -110,14 +110,13 @@ def initialize_google_client(options) auth = options[:google_auth] else # fall back to Application Default Credentials before erroring - begin - auth = ::Google::Auth::DefaultCredentials.from_well_known_path( - options[:google_api_scope_url] - ) - rescue StandardError + auth = ::Google::Auth.get_application_default( + options[:google_api_scope_url] + ) + if auth.nil? raise ArgumentError.new( - "Application Default Credentials not found; Missing required " \ - "arguments: google_json_key_location, google_json_key_string or google_auth" + "Missing required arguments: google_json_key_location, " \ + "google_json_key_string or google_auth" ) end end From 03e91b1b1526e672eb36816aafda022b6da4b135 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Wed, 20 Mar 2019 15:36:14 +1100 Subject: [PATCH 30/46] Remove deprecated `google_client_email` option `google_clien_email` is an auth option that was leftover from PKCS12 key days and is no longer required as it is baked into all json keys and is no longer supplied to any auth method --- .fog.example | 1 - CONTRIBUTING.md | 1 - ci/credentials.yml.template | 2 -- ci/pipeline.yml | 9 --------- ci/tasks/run-int.sh | 2 -- ci/tasks/run-int.yml | 1 - lib/fog/compute/google.rb | 1 - lib/fog/dns/google.rb | 1 - lib/fog/google/monitoring.rb | 1 - lib/fog/google/pubsub.rb | 1 - lib/fog/google/shared.rb | 11 +++++------ lib/fog/google/sql.rb | 1 - lib/fog/storage/google_json.rb | 1 - test/unit/storage/test_json_requests.rb | 1 - 14 files changed, 5 insertions(+), 29 deletions(-) diff --git a/.fog.example b/.fog.example index 3779e753a1..a3c6b2078b 100644 --- a/.fog.example +++ b/.fog.example @@ -15,7 +15,6 @@ # START GOOGLE CONFIG my_google_credentials: google_project: my-project-id - google_client_email: xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com google_json_key_location: /path/to/my-project-xxxxxxxxxxxx.json # You can also provide service account credentials with `google_json_key_string` or # with `google_key_location` and `google_key_string` for P12 private keys. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef45ddd974..f5a195caec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,7 +94,6 @@ make sure you have a `:test` credential in `~/.fog`, something like: ``` test: google_project: my-project - google_client_email: xxxxxxxxxxxxx-xxxxxxxxxxxxx@developer.gserviceaccount.com google_json_key_location: /path/to/my-project-xxxxxxxxxxxxx.json ``` diff --git a/ci/credentials.yml.template b/ci/credentials.yml.template index d1973e2aa4..b2f1249d54 100644 --- a/ci/credentials.yml.template +++ b/ci/credentials.yml.template @@ -3,8 +3,6 @@ codecov_token: # Google Cloud Platform project to run under google_project: -# Google Compute Engine Service Account email -google_client_email: # Google Compute Engine Service Account JSON google_json_key_data: | { diff --git a/ci/pipeline.yml b/ci/pipeline.yml index cd475f2d9c..6ec0d52378 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -16,7 +16,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -40,7 +39,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -64,7 +62,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -88,7 +85,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -112,7 +108,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -136,7 +131,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -160,7 +154,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -184,7 +177,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: @@ -208,7 +200,6 @@ jobs: codecov_token: {{codecov_token}} google_project: {{google_project}} google_json_key_data: {{google_json_key_data}} - google_client_email: {{google_client_email}} on_failure: put: pull-request params: diff --git a/ci/tasks/run-int.sh b/ci/tasks/run-int.sh index 82865bb3a3..616319522d 100755 --- a/ci/tasks/run-int.sh +++ b/ci/tasks/run-int.sh @@ -13,7 +13,6 @@ source ci/tasks/utils.sh popd > /dev/null check_param google_project -check_param google_client_email check_param google_json_key_data check_param rake_task check_param codecov_token @@ -23,7 +22,6 @@ echo $google_json_key_data > `pwd`/service_account_key.json cat >~/.fog < StringIO.new(json_key_hash.to_json), :scope => options[:google_api_scope_url] diff --git a/lib/fog/google/sql.rb b/lib/fog/google/sql.rb index bfa7fd9bc6..25461b25f7 100644 --- a/lib/fog/google/sql.rb +++ b/lib/fog/google/sql.rb @@ -10,7 +10,6 @@ class SQL < Fog::Service :app_version, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, diff --git a/lib/fog/storage/google_json.rb b/lib/fog/storage/google_json.rb index def098ff01..a7d2cbfbda 100644 --- a/lib/fog/storage/google_json.rb +++ b/lib/fog/storage/google_json.rb @@ -11,7 +11,6 @@ class GoogleJSON < Fog::Service :app_version, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, diff --git a/test/unit/storage/test_json_requests.rb b/test/unit/storage/test_json_requests.rb index 1d4d87475a..3111d19e87 100644 --- a/test/unit/storage/test_json_requests.rb +++ b/test/unit/storage/test_json_requests.rb @@ -4,7 +4,6 @@ class UnitTestJsonRequests < MiniTest::Test def setup Fog.mock! @client = Fog::Storage.new(provider: "google", - google_client_email: "", google_project: "", google_json_key_location: "") end From 1249eedda98c86a3350ffa1f442eaeb013038a96 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Wed, 20 Mar 2019 16:32:43 +1100 Subject: [PATCH 31/46] Remove leftover test for google_client_email --- test/integration/test_authentication.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/integration/test_authentication.rb b/test/integration/test_authentication.rb index 05ab6ad680..f3dc457fa9 100644 --- a/test/integration/test_authentication.rb +++ b/test/integration/test_authentication.rb @@ -27,13 +27,6 @@ def test_raises_argument_error_when_google_project_is_missing assert_raises(ArgumentError) { Fog::Compute::Google.new(:google_project => nil) } end - def test_raises_argument_error_when_google_client_email_is_missing - assert_raises(ArgumentError) do - Fog::Compute::Google.new(:google_client_email => nil, - :google_json_key_location => nil) - end # JSON key overrides google_client_email - end - def test_raises_argument_error_when_google_keys_are_given assert_raises(ArgumentError) do Fog::Compute::Google.new(:google_key_location => nil, From e62565781b7cfe17d9b12026cb5d197df062c115 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Wed, 20 Mar 2019 21:29:59 +1100 Subject: [PATCH 32/46] Rework auth workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Separate different auth streams into private methods - Separated some logic into helper methods - Switch to File.read when loading up JSON key - Do not decode/re-encode JSON keys when loading up auth - Add a warning if we’re falling back on Google Application Default auth --- lib/fog/google/shared.rb | 146 ++++++++++++++++++++++++++------------- 1 file changed, 97 insertions(+), 49 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 1ddbdfe552..133252f9cb 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -49,30 +49,7 @@ def initialize_google_client(options) raise error end - # Users can no longer provide their own clients due to rewrite of auth - # in https://github.com/google/google-api-ruby-client/ version 0.9. - if options[:google_client] - raise ArgumentError.new("Deprecated argument no longer works: google_client") - end - - # They can also no longer use pkcs12 files, because Google's new auth - # library doesn't support them either. - if options[:google_key_location] - raise ArgumentError.new("Deprecated argument no longer works: google_key_location") - end - if options[:google_key_string] - raise ArgumentError.new("Deprecated argument no longer works: google_key_string") - end - - - if options[:google_client_email] - Fog::Logger.warning("Deprecated argument no longer required: google_client_email") - end - - # Validate required arguments - unless options[:google_api_scope_url] - raise ArgumentError.new("Missing required arguments: google_api_scope_url") - end + validate_client_options(options) application_name = "fog" unless options[:app_name].nil? @@ -88,36 +65,31 @@ def initialize_google_client(options) end auth = nil - if options[:google_json_key_location] || options[:google_json_key_string] - if options[:google_json_key_location] - json_key_location = File.expand_path(options[:google_json_key_location]) - json_key = File.open(json_key_location, "r", &:read) - else - json_key = options[:google_json_key_string] - end - json_key_hash = Fog::JSON.decode(json_key) - unless json_key_hash.key?("client_email") || json_key_hash.key?("private_key") - raise ArgumentError.new("Invalid Google JSON key") - end - - auth = ::Google::Auth::ServiceAccountCredentials.make_creds( - :json_key_io => StringIO.new(json_key_hash.to_json), - :scope => options[:google_api_scope_url] - ) + if options[:google_json_key_location] || options[:google_json_key_string] + auth = process_key_auth(options) elsif options[:google_auth] auth = options[:google_auth] + elsif options[:application_default] + auth = process_application_default_auth(options) else - # fall back to Application Default Credentials before erroring - auth = ::Google::Auth.get_application_default( - options[:google_api_scope_url] + Fog::Logger.warning( + "Didn't detect any explicit auth settings, " \ + "trying to use application default credentials." + ) + auth = process_application_default_auth(options) + end + + if auth.nil? + raise Fog::Errors::Error.new( + "Failed to configure authentication for Fog client.\n" \ + "Check your auth options, must be one of:\n" \ + "- :google_json_key_location,\n" \ + "- :google_json_key_string,\n" \ + "- :google_auth,\n" \ + "- :application_default,\n" \ + "If credentials are valid - please, file a bug to fog-google." \ ) - if auth.nil? - raise ArgumentError.new( - "Missing required arguments: google_json_key_location, " \ - "google_json_key_string or google_auth" - ) - end end ::Google::Apis::RequestOptions.default.authorization = auth @@ -193,6 +165,82 @@ def build_excon_response(body, status = 200) response end + + private + + # Helper method to process application default authentication + # + # @param [Hash] options - client options hash + # @return [Google::Auth::DefaultCredentials] - google auth object + def process_application_default_auth(options) + begin + return ::Google::Auth.get_application_default(options[:google_api_scope_url]) + rescue RuntimeError => e + # Google API Client returns runtime error if it cannot load up creds + nil + end + end + + # Helper method to process key authentication + # + # @param [Hash] options - client options hash + # @return [Google::Auth::ServiceAccountCredentials] - google auth object + def process_key_auth(options) + if options[:google_json_key_location] + json_key = File.read(File.expand_path(options[:google_json_key_location])) + elsif options[:google_json_key_string] + json_key = options[:google_json_key_string] + end + + validate_json_credentials(json_key) + + ::Google::Auth::ServiceAccountCredentials.make_creds( + :json_key_io => StringIO.new(json_key), + :scope => options[:google_api_scope_url] + ) + end + + # Helper method to sort out deprecated and missing auth options + # + # @param [Hash] options - client options hash + def validate_client_options(options) + # Users can no longer provide their own clients due to rewrite of auth + # in https://github.com/google/google-api-ruby-client/ version 0.9. + if options[:google_client] + raise ArgumentError.new("Deprecated argument no longer works: google_client") + end + + # They can also no longer use pkcs12 files, because Google's new auth + # library doesn't support them either. + if options[:google_key_location] + raise ArgumentError.new("Deprecated auth method no longer works: google_key_location") + end + if options[:google_key_string] + raise ArgumentError.new("Deprecated auth method no longer works: google_key_string") + end + + # Google client email option is no longer needed + if options[:google_client_email] + Fog::Logger.deprecation("Argument no longer needed for auth: google_client_email") + end + + # Validate required arguments + unless options[:google_api_scope_url] + raise ArgumentError.new("Missing required arguments: google_api_scope_url") + end + end + + # Helper method to checks whether the necessary fields are present in + # JSON key credentials + # + # @param [String] json_key - Google json auth key string + def validate_json_credentials(json_key) + json_key_hash = Fog::JSON.decode(json_key) + + unless json_key_hash.key?("client_email") || json_key_hash.key?("private_key") + raise ArgumentError.new("Invalid Google JSON key") + end + end end end end From 9612f932d55449372839e86af4b2378a246f5aee Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 21 Mar 2019 09:48:24 +1100 Subject: [PATCH 33/46] Put the fallback auth into a separate method --- lib/fog/google/shared.rb | 46 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 133252f9cb..c7a691d523 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -73,23 +73,7 @@ def initialize_google_client(options) elsif options[:application_default] auth = process_application_default_auth(options) else - Fog::Logger.warning( - "Didn't detect any explicit auth settings, " \ - "trying to use application default credentials." - ) - auth = process_application_default_auth(options) - end - - if auth.nil? - raise Fog::Errors::Error.new( - "Failed to configure authentication for Fog client.\n" \ - "Check your auth options, must be one of:\n" \ - "- :google_json_key_location,\n" \ - "- :google_json_key_string,\n" \ - "- :google_auth,\n" \ - "- :application_default,\n" \ - "If credentials are valid - please, file a bug to fog-google." \ - ) + auth = process_fallback_auth(options) end ::Google::Apis::RequestOptions.default.authorization = auth @@ -173,11 +157,31 @@ def build_excon_response(body, status = 200) # @param [Hash] options - client options hash # @return [Google::Auth::DefaultCredentials] - google auth object def process_application_default_auth(options) + ::Google::Auth.get_application_default(options[:google_api_scope_url]) + end + + # Helper method to process fallback authentication + # Current fallback is application default authentication + # + # @param [Hash] options - client options hash + # @return [Google::Auth::DefaultCredentials] - google auth object + def process_fallback_auth(options) + Fog::Logger.warning( + "Didn't detect any client auth settings, " \ + "trying to fall back to application default credentials..." + ) begin - return ::Google::Auth.get_application_default(options[:google_api_scope_url]) - rescue RuntimeError => e - # Google API Client returns runtime error if it cannot load up creds - nil + return process_application_default_auth(options) + rescue + raise Fog::Errors::Error.new( + "Fallback auth failed, could not configure authentication for Fog client.\n" \ + "Check your auth options, must be one of:\n" \ + "- :google_json_key_location,\n" \ + "- :google_json_key_string,\n" \ + "- :google_auth,\n" \ + "- :application_default,\n" \ + "If credentials are valid - please, file a bug to fog-google." \ + ) end end From 1e11db915b016ae5a9ba13a2b88970e678db789e Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 21 Mar 2019 09:49:12 +1100 Subject: [PATCH 34/46] Rename cred name application_default -> google_application_default to follow convention --- lib/fog/google/shared.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index c7a691d523..c05e7d65bd 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -20,6 +20,7 @@ def shared_initialize(project, api_version, base_url) # Initializes the Google API Client # # @param [Hash] options Google API options + # @option options [Bool] :google_application_default Explicitly use application default credentials # @option options [Google::Auth|Signet] :google_auth Manually created authorization to use # @option options [String] :google_key_location The location of a pkcs12 key file # @option options [String] :google_key_string The content of the pkcs12 key file @@ -70,7 +71,7 @@ def initialize_google_client(options) auth = process_key_auth(options) elsif options[:google_auth] auth = options[:google_auth] - elsif options[:application_default] + elsif options[:google_application_default] auth = process_application_default_auth(options) else auth = process_fallback_auth(options) @@ -179,7 +180,7 @@ def process_fallback_auth(options) "- :google_json_key_location,\n" \ "- :google_json_key_string,\n" \ "- :google_auth,\n" \ - "- :application_default,\n" \ + "- :google_application_default,\n" \ "If credentials are valid - please, file a bug to fog-google." \ ) end From 5ba750509dc4d70dc47570b0bfd8af5d107aeaec Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 21 Mar 2019 09:57:01 +1100 Subject: [PATCH 35/46] Address linter --- lib/fog/google/shared.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index c05e7d65bd..5473f083a0 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -168,20 +168,20 @@ def process_application_default_auth(options) # @return [Google::Auth::DefaultCredentials] - google auth object def process_fallback_auth(options) Fog::Logger.warning( - "Didn't detect any client auth settings, " \ - "trying to fall back to application default credentials..." + "Didn't detect any client auth settings, " \ + "trying to fall back to application default credentials..." ) begin return process_application_default_auth(options) rescue raise Fog::Errors::Error.new( - "Fallback auth failed, could not configure authentication for Fog client.\n" \ - "Check your auth options, must be one of:\n" \ - "- :google_json_key_location,\n" \ - "- :google_json_key_string,\n" \ - "- :google_auth,\n" \ - "- :google_application_default,\n" \ - "If credentials are valid - please, file a bug to fog-google." \ + "Fallback auth failed, could not configure authentication for Fog client.\n" \ + "Check your auth options, must be one of:\n" \ + "- :google_json_key_location,\n" \ + "- :google_json_key_string,\n" \ + "- :google_auth,\n" \ + "- :google_application_default,\n" \ + "If credentials are valid - please, file a bug to fog-google." \ ) end end @@ -200,8 +200,8 @@ def process_key_auth(options) validate_json_credentials(json_key) ::Google::Auth::ServiceAccountCredentials.make_creds( - :json_key_io => StringIO.new(json_key), - :scope => options[:google_api_scope_url] + :json_key_io => StringIO.new(json_key), + :scope => options[:google_api_scope_url] ) end From 26e5ebde0b6f05ad85f71cdc93ab163856cbc4d7 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Fri, 22 Mar 2019 09:16:08 +1100 Subject: [PATCH 36/46] Remove deprecated options from docs --- .fog.example | 3 +-- lib/fog/google/shared.rb | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.fog.example b/.fog.example index a3c6b2078b..f2f8d97df1 100644 --- a/.fog.example +++ b/.fog.example @@ -16,8 +16,7 @@ my_google_credentials: google_project: my-project-id google_json_key_location: /path/to/my-project-xxxxxxxxxxxx.json - # You can also provide service account credentials with `google_json_key_string` or - # with `google_key_location` and `google_key_string` for P12 private keys. + # You can also provide service account credentials with `google_json_key_string` # If so, uncomment the two following lines. # HMAC credentials follow a similar format: #google_storage_access_key_id: GOOGXXXXXXXXXXXXXXXX diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index 5473f083a0..78ecaaf750 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -22,14 +22,11 @@ def shared_initialize(project, api_version, base_url) # @param [Hash] options Google API options # @option options [Bool] :google_application_default Explicitly use application default credentials # @option options [Google::Auth|Signet] :google_auth Manually created authorization to use - # @option options [String] :google_key_location The location of a pkcs12 key file - # @option options [String] :google_key_string The content of the pkcs12 key file # @option options [String] :google_json_key_location The location of a JSON key file # @option options [String] :google_json_key_string The content of the JSON key file # @option options [String] :google_api_scope_url The access scope URLs # @option options [String] :app_name The app name to set in the user agent # @option options [String] :app_version The app version to set in the user agent - # @option options [Google::APIClient] :google_client Existing Google API Client # @option options [Hash] :google_client_options A hash to send additional options to Google API Client # @return [Google::APIClient] Google API Client # @raises [ArgumentError] If there is any missing argument From 1749e9b56632c6efc964321162455bbd41f98594 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Fri, 22 Mar 2019 11:11:39 +1100 Subject: [PATCH 37/46] Update service options with new client option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add :google_application_default to avoid “unrecognised parameter” warnings --- lib/fog/dns/google.rb | 1 + lib/fog/google/monitoring.rb | 2 ++ lib/fog/google/pubsub.rb | 1 + lib/fog/google/sql.rb | 1 + lib/fog/storage/google_json.rb | 1 + 5 files changed, 6 insertions(+) diff --git a/lib/fog/dns/google.rb b/lib/fog/dns/google.rb index 0198ebcf41..62f9d0ea53 100644 --- a/lib/fog/dns/google.rb +++ b/lib/fog/dns/google.rb @@ -8,6 +8,7 @@ class Google < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, :google_client_options, diff --git a/lib/fog/google/monitoring.rb b/lib/fog/google/monitoring.rb index 94e8855680..bf8db128ae 100644 --- a/lib/fog/google/monitoring.rb +++ b/lib/fog/google/monitoring.rb @@ -8,6 +8,8 @@ class Monitoring < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, + :google_auth, :google_client, :google_client_options, :google_key_location, diff --git a/lib/fog/google/pubsub.rb b/lib/fog/google/pubsub.rb index 6832c1164d..04ea7f1d8e 100644 --- a/lib/fog/google/pubsub.rb +++ b/lib/fog/google/pubsub.rb @@ -8,6 +8,7 @@ class Pubsub < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, :google_client_options, diff --git a/lib/fog/google/sql.rb b/lib/fog/google/sql.rb index 25461b25f7..fe584e42e5 100644 --- a/lib/fog/google/sql.rb +++ b/lib/fog/google/sql.rb @@ -8,6 +8,7 @@ class SQL < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, :google_client_options, diff --git a/lib/fog/storage/google_json.rb b/lib/fog/storage/google_json.rb index a7d2cbfbda..733ecab3d3 100644 --- a/lib/fog/storage/google_json.rb +++ b/lib/fog/storage/google_json.rb @@ -9,6 +9,7 @@ class GoogleJSON < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, :google_client_options, From 9d6ab98b5dfbd30326f75069201340e7cc807583 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Fri, 22 Mar 2019 11:27:53 +1100 Subject: [PATCH 38/46] Bump version, update README and CHANGELOG --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ README.md | 14 ++++++++++++++ lib/fog/google/version.rb | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 193a07afe9..fdeb018b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,35 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Next +## 1.9.0 + +### User-facing + +#### Added + +- \#442 Add support for Application Default credentials [mavin] + - This change allows the use of Application Default Credentials so that end + users can authenticate without a service account for development, testing, + and one-off interactions by using `:google_application_default`client + option. See README for more details. + +### Fixed + +- \#444 Remove deprecated `google_client_email` option from client parameters + [temikus] +- \#446 Updating service parameters to avoid "unrecognised parameter" warnings + when initializing Fog client with application default auth [temikus] + +### Development changes + +#### Fixed + +- \#441 Update CI pipeline to Concourse V4 [temikus] +- \#444 Rework client authentication workflow [temikus] + - Separate different auth streams into private helper methods + - Add a fallback auth option - Google Application Default credentials + - Minor fixes and performance optimizations + ## 1.8.2 ### User-facing diff --git a/README.md b/README.md index bc557681a5..1689398c53 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,20 @@ cat .fog.example >> ~/.fog # appends the sample configuration vim ~/.fog # edit file with yout config ``` +As of `1.9.0` fog-google supports Google [application default credentials (ADC)](https://cloud.google.com/docs/authentication/production) +The auth method uses [Google::Auth.get_application_default](https://www.rubydoc.info/gems/googleauth/0.6.7/Google%2FAuth.get_application_default) +under the hood. + +Example workflow for a GCE instance with [service account scopes](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances) +defined: + +``` +> connection = Fog::Compute::Google.new(:google_project => "my-project", :google_application_default => true) +=> # connection.servers +=> [ Date: Wed, 27 Mar 2019 08:36:27 -0600 Subject: [PATCH 39/46] fix: Add `:google_application_default` as recognized argument Fog::Compute::Google --- lib/fog/compute/google.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fog/compute/google.rb b/lib/fog/compute/google.rb index 965844e26a..44cb64f24b 100644 --- a/lib/fog/compute/google.rb +++ b/lib/fog/compute/google.rb @@ -8,6 +8,7 @@ class Google < Fog::Service recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, :google_client_options, From 2313ac894c7683182931125cae1de4f66bd5902f Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 12:10:22 +1100 Subject: [PATCH 40/46] Add a helper rake task to populate changelog --- tasks/changelog.rake | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tasks/changelog.rake diff --git a/tasks/changelog.rake b/tasks/changelog.rake new file mode 100644 index 0000000000..124a20d449 --- /dev/null +++ b/tasks/changelog.rake @@ -0,0 +1,30 @@ +require "fileutils" + +# Helper method to insert text after a line that matches the regex +def insert_after_line(file, insert, regex = /^## Next/) + tempfile = File.open("#{file}.tmp", "w") + f = File.new(file) + f.each do |line| + tempfile << line + next unless line =~ regex + + tempfile << "\n" + tempfile << insert + tempfile << "\n" + end + f.close + tempfile.close + + FileUtils.mv("#{file}.tmp", file) +end + +# Extracts all changes that have been made after the latest pushed tag +def changes_since_last_tag + `git --no-pager log $(git describe --tags --abbrev=0)..HEAD --oneline` +end + +namespace :changelog do + task :generate do + insert_after_line("CHANGELOG.md", changes_since_last_tag, /^## Next/) + end +end From de642177abd409e6603f33f98f495fbeada1d462 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 12:22:27 +1100 Subject: [PATCH 41/46] Release 1.9.1 --- CHANGELOG.md | 17 +++++++++++++++-- lib/fog/google/version.rb | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdeb018b91..502f4fc948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,21 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html ## Next +## 1.9.1 + +### User-facing + +#### Fixed + +- \#448 Add `:google_application_default` as recognized argument in + Fog::Compute::Google client [mavin] + +### Development changes + +#### Added + +- \#449 Add a helper rake task to populate changelog [temikus] + ## 1.9.0 ### User-facing @@ -323,8 +338,6 @@ We encourage people using 0.5.1 to upgrade. ## Template to use -## Next release - ### User-facing #### Changed diff --git a/lib/fog/google/version.rb b/lib/fog/google/version.rb index 70b3ff8c16..9c6a046e2d 100644 --- a/lib/fog/google/version.rb +++ b/lib/fog/google/version.rb @@ -1,5 +1,5 @@ module Fog module Google - VERSION = "1.9.0".freeze + VERSION = "1.9.1".freeze end end From 7d28916650f499e3f2484d84e78eb38c0c8cb5d8 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 20:13:03 +1100 Subject: [PATCH 42/46] Insert a skip in SD pagination tests Addressing #451 --- test/integration/monitoring/test_metric_descriptors.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/monitoring/test_metric_descriptors.rb b/test/integration/monitoring/test_metric_descriptors.rb index e49eb07e14..7c2ab3a559 100644 --- a/test/integration/monitoring/test_metric_descriptors.rb +++ b/test/integration/monitoring/test_metric_descriptors.rb @@ -104,6 +104,10 @@ def test_metric_descriptors_all descriptors = @client.metric_descriptors.all assert_operator(descriptors.size, :>, 0, "metric descriptor count should be positive") + end + + def test_metric_descriptors_all_page_size + skip("Skipping until API-side issue is resolved, see #451") descriptors = @client.metric_descriptors.all( :filter => 'metric.type = starts_with("compute.googleapis.com")', From 7232ebbf730c06384c8ac28880dbd261059ff2ba Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 20:39:56 +1100 Subject: [PATCH 43/46] Fix Address.disassociate method Would otherwise error out on `unless async` Made the method synchronous by default as well --- lib/fog/compute/google/models/address.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/compute/google/models/address.rb b/lib/fog/compute/google/models/address.rb index d03d60cd27..299054930f 100755 --- a/lib/fog/compute/google/models/address.rb +++ b/lib/fog/compute/google/models/address.rb @@ -86,7 +86,7 @@ def associate(nic_name, async = true) operation.wait_for { ready? } unless async end - def disassociate + def disassociate(async = false) requires :address return nil if !in_use? || users.nil? || users.empty? From 511cea2e717df3b6b9f7cbd83cb0f482fb43373d Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 20:40:31 +1100 Subject: [PATCH 44/46] Increase Address model test coverage --- .../compute/core_networking/test_addresses.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/integration/compute/core_networking/test_addresses.rb b/test/integration/compute/core_networking/test_addresses.rb index 7e1b33c760..ed659e13f6 100644 --- a/test/integration/compute/core_networking/test_addresses.rb +++ b/test/integration/compute/core_networking/test_addresses.rb @@ -32,6 +32,21 @@ def test_run_instance @subject.get(address.name, TEST_REGION).status, "Address should now be in use" ) + + address.reload + + assert_equal( + server, + address.server, + "Address.server should return an associated server object" + ) + + address.server = nil + address.reload + assert_nil( + address.server, + "Address should not be associated with a server after disassociation" + ) end def test_bad_get From 67d3d0611c1d6593083f3fe0c43f9a737c58e750 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Thu, 28 Mar 2019 21:47:53 +1100 Subject: [PATCH 45/46] Fix Address.associate method This appears to have not worked before at all due to mismatched parameters. Added a test to check the behaviour going forward. --- lib/fog/compute/google/models/address.rb | 15 ++++++++++++++- .../compute/core_networking/test_addresses.rb | 8 ++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/google/models/address.rb b/lib/fog/compute/google/models/address.rb index 299054930f..901d0049f0 100755 --- a/lib/fog/compute/google/models/address.rb +++ b/lib/fog/compute/google/models/address.rb @@ -74,7 +74,15 @@ def ready? private - def associate(nic_name, async = true) + # Associates the ip address to a given server + # + # @param [String] server - GCE instance name + # @param [String] nic_name - NIC interface name, defaults to GCE + # standard primary nic - "nic0" + # @param [Boolean] async - whether to run the operation asynchronously + # + # @return [Fog::Compute::Google::Operation] + def associate(server, nic_name = "nic0", async = false) requires :address data = service.add_server_access_config( @@ -86,6 +94,11 @@ def associate(nic_name, async = true) operation.wait_for { ready? } unless async end + # Disassociates the ip address from a resource it's attached to + # + # @param [Boolean] async - whether to run the operation asynchronously + # + # @return [Fog::Compute::Google::Operation] def disassociate(async = false) requires :address diff --git a/test/integration/compute/core_networking/test_addresses.rb b/test/integration/compute/core_networking/test_addresses.rb index ed659e13f6..019e2d95fa 100644 --- a/test/integration/compute/core_networking/test_addresses.rb +++ b/test/integration/compute/core_networking/test_addresses.rb @@ -47,6 +47,14 @@ def test_run_instance address.server, "Address should not be associated with a server after disassociation" ) + + address.server = server + address.reload + assert_equal( + server, + address.server, + "Address should be associated with a server after association" + ) end def test_bad_get From cd7b1c57e2b711f7eaa4ae89d88ec8c774fb30c7 Mon Sep 17 00:00:00 2001 From: Artem Yakimenko Date: Fri, 29 Mar 2019 09:16:49 +1100 Subject: [PATCH 46/46] Cache bundling artefacts --- ci/pipeline-dev.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++ ci/tasks/run-int.sh | 12 ++++++++- ci/tasks/run-int.yml | 2 ++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 ci/pipeline-dev.yml diff --git a/ci/pipeline-dev.yml b/ci/pipeline-dev.yml new file mode 100644 index 0000000000..67516c4b6c --- /dev/null +++ b/ci/pipeline-dev.yml @@ -0,0 +1,58 @@ +jobs: + - name: integration-tests-monitoring + serial: true + plan: + - get: fog-google-src + resource: pull-request + version: every + trigger: true + - put: pull-request + params: {path: fog-google-src, status: pending} + + - task: run-integration-tests + file: fog-google-src/ci/tasks/run-int.yml + params: + rake_task: test:monitoring + codecov_token: {{codecov_token}} + google_project: {{google_project}} + google_json_key_data: {{google_json_key_data}} + on_failure: + put: pull-request + params: + path: fog-google-src + status: failure + + - name: github-pr-aggregator + plan: + - get: fog-google-src + resource: pull-request + passed: [integration-tests-monitoring] + trigger: true + on_success: + put: pull-request + params: + path: fog-google-src + status: success + on_failure: + put: pull-request + params: + path: fog-google-src + status: failure + +resources: + - name: pull-request + type: pull-request + source: + access_token: {{github_access_token}} + private_key: {{github_private_key}} + label: integrate-dev + repo: fog/fog-google + +resource_types: + # This is a third party resource. + # The referenced docker-image is maintained externally + # https://github.com/jtarchie/pullrequest-resource + - name: pull-request + type: docker-image + source: + repository: jtarchie/pr \ No newline at end of file diff --git a/ci/tasks/run-int.sh b/ci/tasks/run-int.sh index 616319522d..89f384dd7c 100755 --- a/ci/tasks/run-int.sh +++ b/ci/tasks/run-int.sh @@ -27,8 +27,18 @@ EOL pushd ${release_dir} > /dev/null -bundle install --jobs=3 --retry=3 +echo "Exporting bundler options..." +# Setting via local config options as BUNDLE_PATH appears to not work +# see https://github.com/rails/spring/issues/339 +bundle config --local path ../../bundle +bundle config --local bin ../../bundle/bin + +echo "Checking dependencies..." +# Check if dependencies are satisfied, otherwise kick off bundle install +bundle check || bundle install --jobs=3 --retry=3 + +echo "Starting test run..." FOG_MOCK=false COVERAGE=true CODECOV_TOKEN=${codecov_token} rake ${rake_task} popd > /dev/null \ No newline at end of file diff --git a/ci/tasks/run-int.yml b/ci/tasks/run-int.yml index ce2439be92..ea6dd4b679 100644 --- a/ci/tasks/run-int.yml +++ b/ci/tasks/run-int.yml @@ -8,6 +8,8 @@ inputs: path: src/fog-google run: path: src/fog-google/ci/tasks/run-int.sh +caches: +- path: bundle params: rake_task: replace-me codecov_token: replace-me