fog-google 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +11 -11
- data/README.md +7 -7
- data/examples/create_instance_and_attach_disk_later.rb +6 -7
- data/examples/dns/project.rb +1 -1
- data/examples/dns/zones.rb +1 -1
- data/examples/storage.rb +1 -1
- data/examples/storage_json.rb +1 -1
- data/fog-google.gemspec +1 -1
- data/lib/fog/bin/google.rb +23 -25
- data/lib/fog/{compute/google → google/compute}/mock.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/address.rb +8 -8
- data/lib/fog/{compute/google → google/compute}/models/addresses.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/backend_service.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/backend_services.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/disk.rb +5 -5
- data/lib/fog/{compute/google → google/compute}/models/disk_type.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/disk_types.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/disks.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/firewall.rb +6 -6
- data/lib/fog/{compute/google → google/compute}/models/firewalls.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/forwarding_rule.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/forwarding_rules.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/global_address.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/global_addresses.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/global_forwarding_rule.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/global_forwarding_rules.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/http_health_check.rb +5 -5
- data/lib/fog/{compute/google → google/compute}/models/http_health_checks.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/image.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/images.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/instance_group.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/instance_group_manager.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/instance_group_managers.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/instance_groups.rb +5 -5
- data/lib/fog/{compute/google → google/compute}/models/instance_template.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/instance_templates.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/machine_type.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/machine_types.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/network.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/networks.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/operations.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/project.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/projects.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/region.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/regions.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/route.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/routes.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/server.rb +18 -18
- data/lib/fog/{compute/google → google/compute}/models/servers.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/snapshot.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/snapshots.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/ssl_certificate.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/ssl_certificates.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/subnetwork.rb +6 -6
- data/lib/fog/{compute/google → google/compute}/models/subnetworks.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/target_http_proxies.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/target_http_proxy.rb +5 -5
- data/lib/fog/{compute/google → google/compute}/models/target_https_proxies.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/target_https_proxy.rb +7 -7
- data/lib/fog/{compute/google → google/compute}/models/target_instance.rb +4 -4
- data/lib/fog/{compute/google → google/compute}/models/target_instances.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/target_pool.rb +8 -8
- data/lib/fog/{compute/google → google/compute}/models/target_pools.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/url_map.rb +7 -7
- data/lib/fog/{compute/google → google/compute}/models/url_maps.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/models/zone.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/models/zones.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/real.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/abandon_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/add_backend_service_backends.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/add_instance_group_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/add_server_access_config.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/add_target_pool_health_checks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/add_target_pool_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/attach_disk.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/create_disk_snapshot.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_backend_service.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_disk.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_firewall.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_global_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_global_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_global_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_http_health_check.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_image.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_instance_group.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_instance_group_manager.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_instance_template.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_network.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_region_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_route.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_server.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_server_access_config.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_snapshot.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_ssl_certificate.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_subnetwork.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_target_http_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_target_https_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_target_instance.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_target_pool.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/delete_zone_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/deprecate_image.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/detach_disk.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/expand_subnetwork_ip_cidr_range.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_backend_service.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_backend_service_health.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_disk.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_disk_type.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_firewall.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_global_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_global_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_global_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_http_health_check.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_image.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_image_from_family.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_instance_group.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_instance_group_manager.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_instance_template.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_machine_type.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_network.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_project.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_region.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_region_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_route.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_server.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_server_serial_port_output.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_snapshot.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_ssl_certificate.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_subnetwork.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_target_http_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_target_https_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_target_instance.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_target_pool.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_target_pool_health.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_zone.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/get_zone_operation.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_backend_service.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_disk.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_firewall.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_global_address.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_global_forwarding_rule.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_http_health_check.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_image.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_instance_group.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_instance_group_manager.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_instance_template.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_network.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_route.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_server.rb +3 -3
- data/lib/fog/{compute/google → google/compute}/requests/insert_ssl_certificate.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_subnetwork.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_target_http_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_target_https_proxy.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_target_instance.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_target_pool.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/insert_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/invalidate_url_map_cache.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_addresses.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_addresses.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_disk_types.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_disks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_forwarding_rules.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_instance_group_managers.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_instance_groups.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_machine_types.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_servers.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_subnetworks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_target_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_aggregated_target_pools.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_backend_services.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_disk_types.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_disks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_firewalls.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_forwarding_rules.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_global_addresses.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_global_forwarding_rules.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_global_operations.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_http_health_checks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_images.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_instance_group_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_instance_group_managers.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_instance_groups.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_instance_templates.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_machine_types.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_networks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_region_operations.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_regions.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_routes.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_servers.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_snapshots.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_ssl_certificates.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_subnetworks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_target_http_proxies.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_target_https_proxies.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_target_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_target_pools.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_url_maps.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_zone_operations.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/list_zones.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/patch_firewall.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/patch_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/recreate_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/remove_instance_group_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/remove_target_pool_health_checks.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/remove_target_pool_instance.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/remove_target_pool_instances.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/reset_server.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/reset_windows_password.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_common_instance_metadata.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_forwarding_rule_target.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_global_forwarding_rule_target.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_instance_template.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_server_disk_auto_delete.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_server_machine_type.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_server_metadata.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_server_scheduling.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_server_tags.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_snapshot_labels.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_subnetwork_private_ip_google_access.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_target_http_proxy_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_target_https_proxy_ssl_certificates.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_target_https_proxy_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/set_target_pool_backup.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/start_server.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/stop_server.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/update_firewall.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/update_http_health_check.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/update_url_map.rb +2 -2
- data/lib/fog/{compute/google → google/compute}/requests/validate_url_map.rb +2 -2
- data/lib/fog/{compute/google.rb → google/compute.rb} +6 -6
- data/lib/fog/{dns/google → google/dns}/mock.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/models/change.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/models/changes.rb +8 -6
- data/lib/fog/{dns/google → google/dns}/models/project.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/models/projects.rb +4 -4
- data/lib/fog/{dns/google → google/dns}/models/record.rb +11 -11
- data/lib/fog/{dns/google → google/dns}/models/records.rb +8 -6
- data/lib/fog/{dns/google → google/dns}/models/zone.rb +7 -7
- data/lib/fog/{dns/google → google/dns}/models/zones.rb +6 -5
- data/lib/fog/{dns/google → google/dns}/real.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/create_change.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/create_managed_zone.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/delete_managed_zone.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/get_change.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/get_managed_zone.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/get_project.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/list_changes.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/list_managed_zones.rb +2 -2
- data/lib/fog/{dns/google → google/dns}/requests/list_resource_record_sets.rb +2 -2
- data/lib/fog/{dns/google.rb → google/dns.rb} +6 -6
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/access_control_list.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/copy_object.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_bucket.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_bucket_logging.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_bucket_object_versions.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_bucket_versioning.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_request_payment.rb +3 -3
- data/lib/fog/{parsers/storage/google → google/parsers/storage}/get_service.rb +3 -3
- data/lib/fog/google/parsers/storage.rb +15 -0
- data/lib/fog/google/shared.rb +17 -15
- data/lib/fog/{storage/google_json → google/storage/storage_json}/mock.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/models/directories.rb +4 -3
- data/lib/fog/{storage/google_json → google/storage/storage_json}/models/directory.rb +3 -3
- data/lib/fog/{storage/google_json → google/storage/storage_json}/models/file.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/models/files.rb +8 -7
- data/lib/fog/{storage/google_json → google/storage/storage_json}/real.rb +16 -8
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/copy_object.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/delete_bucket.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/delete_object.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/delete_object_url.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_bucket.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_bucket_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object_http_url.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object_https_url.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object_metadata.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/get_object_url.rb +4 -4
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/list_bucket_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/list_buckets.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/list_object_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/list_objects.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/put_bucket.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/put_bucket_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/put_object.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/put_object_acl.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/requests/put_object_url.rb +2 -2
- data/lib/fog/{storage/google_json → google/storage/storage_json}/utils.rb +4 -4
- data/lib/fog/{storage/google_json.rb → google/storage/storage_json.rb} +9 -9
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/mock.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/models/directories.rb +7 -7
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/models/directory.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/models/file.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/models/files.rb +11 -11
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/real.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/copy_object.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/delete_bucket.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/delete_object.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/delete_object_url.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_bucket.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_bucket_acl.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_object.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_object_acl.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_object_http_url.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_object_https_url.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_object_url.rb +4 -4
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/get_service.rb +3 -3
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/head_object.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/put_bucket.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/put_bucket_acl.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/put_object.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/put_object_acl.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/requests/put_object_url.rb +2 -2
- data/lib/fog/{storage/google_xml → google/storage/storage_xml}/utils.rb +18 -17
- data/lib/fog/{storage/google_xml.rb → google/storage/storage_xml.rb} +7 -7
- data/lib/fog/{storage/google.rb → google/storage.rb} +5 -5
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/google.rb +30 -16
- data/test/integration/compute/core_compute/test_client_options.rb +1 -1
- data/test/integration/compute/core_compute/test_disks.rb +2 -2
- data/test/integration/compute/core_compute/test_snapshots.rb +1 -1
- data/test/integration/factories/collection_factory.rb +2 -2
- data/test/integration/storage/storage_shared.rb +1 -1
- data/test/integration/test_authentication.rb +6 -6
- data/test/unit/compute/test_common_collections.rb +3 -3
- data/test/unit/compute/test_common_models.rb +9 -9
- data/test/unit/compute/test_disk.rb +8 -8
- data/test/unit/compute/test_server.rb +2 -2
- data/test/unit/dns/test_common_collections.rb +3 -3
- data/test/unit/monitoring/test_comon_collections.rb +1 -1
- data/test/unit/pubsub/test_common_collections.rb +1 -1
- data/test/unit/sql/test_common_collections.rb +1 -1
- data/test/unit/storage/test_common_json_collections.rb +2 -2
- data/test/unit/storage/test_common_xml_collections.rb +4 -4
- metadata +319 -322
- data/lib/fog/parsers/storage/google.rb +0 -15
@@ -1,9 +1,9 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
4
|
-
autoload :Mock,
|
5
|
-
autoload :Real,
|
6
|
-
autoload :Utils,
|
2
|
+
module Google
|
3
|
+
class StorageJSON < Fog::Service
|
4
|
+
autoload :Mock, "fog/google/storage/storage_json/mock"
|
5
|
+
autoload :Real, "fog/google/storage/storage_json/real"
|
6
|
+
autoload :Utils, "fog/google/storage/storage_json/utils"
|
7
7
|
|
8
8
|
requires :google_project
|
9
9
|
recognizes(
|
@@ -27,9 +27,9 @@ module Fog
|
|
27
27
|
GOOGLE_STORAGE_JSON_BASE_URL = "https://www.googleapis.com/storage/".freeze
|
28
28
|
GOOGLE_STORAGE_BUCKET_BASE_URL = "https://storage.googleapis.com/".freeze
|
29
29
|
|
30
|
-
# Version of IAM API used for blob signing, see Fog::
|
30
|
+
# Version of IAM API used for blob signing, see Fog::Google::StorageJSON::Real#iam_signer
|
31
31
|
GOOGLE_STORAGE_JSON_IAM_API_VERSION = "v1".freeze
|
32
|
-
GOOGLE_STORAGE_JSON_IAM_API_SCOPE_URLS = %w(https://www.googleapis.com/auth/
|
32
|
+
GOOGLE_STORAGE_JSON_IAM_API_SCOPE_URLS = %w(https://www.googleapis.com/auth/iam).freeze
|
33
33
|
|
34
34
|
# TODO: Come up with a way to only request a subset of permissions.
|
35
35
|
# https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing
|
@@ -37,7 +37,7 @@ module Fog
|
|
37
37
|
|
38
38
|
##
|
39
39
|
# Models
|
40
|
-
model_path "fog/storage/
|
40
|
+
model_path "fog/google/storage/storage_json/models"
|
41
41
|
|
42
42
|
collection :directories
|
43
43
|
model :directory
|
@@ -47,7 +47,7 @@ module Fog
|
|
47
47
|
|
48
48
|
##
|
49
49
|
# Requests
|
50
|
-
request_path "fog/storage/
|
50
|
+
request_path "fog/google/storage/storage_json/requests"
|
51
51
|
request :copy_object
|
52
52
|
request :delete_bucket
|
53
53
|
request :delete_object
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Directories < Fog::Collection
|
5
|
-
model Fog::
|
5
|
+
model Fog::Google::StorageXML::Directory
|
6
6
|
|
7
7
|
def all
|
8
8
|
data = service.get_service.body["Buckets"]
|
@@ -10,10 +10,10 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(key, options = {})
|
13
|
-
remap_attributes(options, :delimiter
|
14
|
-
:marker
|
15
|
-
:max_keys
|
16
|
-
:prefix
|
13
|
+
remap_attributes(options, :delimiter => "delimiter",
|
14
|
+
:marker => "marker",
|
15
|
+
:max_keys => "max-keys",
|
16
|
+
:prefix => "prefix")
|
17
17
|
data = service.get_bucket(key, options).body
|
18
18
|
directory = new(:key => data["Name"])
|
19
19
|
options = {}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Directory < Fog::Model
|
5
5
|
identity :key, :aliases => %w(Name name)
|
6
6
|
|
@@ -23,7 +23,7 @@ module Fog
|
|
23
23
|
|
24
24
|
def files
|
25
25
|
@files ||= begin
|
26
|
-
Fog::
|
26
|
+
Fog::Google::StorageXML::Files.new(
|
27
27
|
:directory => self,
|
28
28
|
:service => service
|
29
29
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Files < Fog::Collection
|
5
5
|
extend Fog::Deprecation
|
6
6
|
deprecate :get_url, :get_https_url
|
@@ -10,18 +10,18 @@ module Fog
|
|
10
10
|
attribute :directory
|
11
11
|
attribute :is_truncated, :aliases => "IsTruncated"
|
12
12
|
attribute :marker, :aliases => "Marker"
|
13
|
-
attribute :max_keys, :aliases =>
|
13
|
+
attribute :max_keys, :aliases => %w(MaxKeys max-keys)
|
14
14
|
attribute :prefix, :aliases => "Prefix"
|
15
15
|
|
16
|
-
model Fog::
|
16
|
+
model Fog::Google::StorageXML::File
|
17
17
|
|
18
18
|
def all(options = {})
|
19
19
|
requires :directory
|
20
20
|
options = {
|
21
|
-
"delimiter"
|
22
|
-
"marker"
|
23
|
-
"max-keys"
|
24
|
-
"prefix"
|
21
|
+
"delimiter" => delimiter,
|
22
|
+
"marker" => marker,
|
23
|
+
"max-keys" => max_keys,
|
24
|
+
"prefix" => prefix
|
25
25
|
}.merge!(options)
|
26
26
|
options = options.reject { |_key, value| value.nil? || value.to_s.empty? }
|
27
27
|
merge_attributes(options)
|
@@ -36,16 +36,16 @@ module Fog
|
|
36
36
|
end
|
37
37
|
|
38
38
|
alias_method :each_file_this_page, :each
|
39
|
-
def each
|
39
|
+
def each(&block)
|
40
40
|
if !block_given?
|
41
41
|
self
|
42
42
|
else
|
43
43
|
subset = dup.all
|
44
44
|
|
45
|
-
subset.each_file_this_page
|
45
|
+
subset.each_file_this_page(&block)
|
46
46
|
while subset.is_truncated
|
47
47
|
subset = subset.all(:marker => subset.last.key)
|
48
|
-
subset.each_file_this_page
|
48
|
+
subset.each_file_this_page(&block)
|
49
49
|
end
|
50
50
|
|
51
51
|
self
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# Copy an object from one Google Storage bucket to another
|
6
6
|
#
|
@@ -28,7 +28,7 @@ module Fog
|
|
28
28
|
:headers => headers,
|
29
29
|
:host => "#{target_bucket_name}.#{@host}",
|
30
30
|
:method => "PUT",
|
31
|
-
:parser => Fog::Parsers::Storage::
|
31
|
+
:parser => Fog::Google::Parsers::Storage::CopyObject.new,
|
32
32
|
:path => Fog::Google.escape(target_object_name))
|
33
33
|
end
|
34
34
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# List information about objects in an Google Storage bucket
|
6
6
|
#
|
@@ -40,7 +40,7 @@ module Fog
|
|
40
40
|
:host => "#{bucket_name}.#{@host}",
|
41
41
|
:idempotent => true,
|
42
42
|
:method => "GET",
|
43
|
-
:parser => Fog::Parsers::Storage::
|
43
|
+
:parser => Fog::Google::Parsers::Storage::GetBucket.new,
|
44
44
|
:query => options)
|
45
45
|
end
|
46
46
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# Get access control list for an Google Storage bucket
|
6
6
|
#
|
@@ -30,7 +30,7 @@ module Fog
|
|
30
30
|
:host => "#{bucket_name}.#{@host}",
|
31
31
|
:idempotent => true,
|
32
32
|
:method => "GET",
|
33
|
-
:parser => Fog::Parsers::Storage::
|
33
|
+
:parser => Fog::Google::Parsers::Storage::AccessControlList.new,
|
34
34
|
:query => { "acl" => nil })
|
35
35
|
end
|
36
36
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# Get access control list for an Google Storage object
|
6
6
|
#
|
@@ -38,7 +38,7 @@ module Fog
|
|
38
38
|
:host => "#{bucket_name}.#{@host}",
|
39
39
|
:idempotent => true,
|
40
40
|
:method => "GET",
|
41
|
-
:parser => Fog::Parsers::Storage::
|
41
|
+
:parser => Fog::Google::Parsers::Storage::AccessControlList.new,
|
42
42
|
:path => Fog::Google.escape(object_name),
|
43
43
|
:query => query)
|
44
44
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# Get an expiring object url from Google Storage
|
6
6
|
#
|
@@ -15,14 +15,14 @@ module Fog
|
|
15
15
|
# * body<~String> - url for object
|
16
16
|
|
17
17
|
def get_object_url(bucket_name, object_name, expires, options = {})
|
18
|
-
Fog::Logger.deprecation("Fog::Storage
|
18
|
+
Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})")
|
19
19
|
get_object_https_url(bucket_name, object_name, expires, options)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
class Mock # :nodoc:all
|
24
24
|
def get_object_url(bucket_name, object_name, expires, options = {})
|
25
|
-
Fog::Logger.deprecation("Fog::Storage
|
25
|
+
Fog::Logger.deprecation("Fog::Google::Storage => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})")
|
26
26
|
get_object_https_url(bucket_name, object_name, expires, options)
|
27
27
|
end
|
28
28
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
class Real
|
5
5
|
# List information about Google Storage buckets for authorized user
|
6
6
|
#
|
@@ -19,7 +19,7 @@ module Fog
|
|
19
19
|
:host => @host,
|
20
20
|
:idempotent => true,
|
21
21
|
:method => "GET",
|
22
|
-
:parser => Fog::Parsers::Storage::
|
22
|
+
:parser => Fog::Google::Parsers::Storage::GetService.new)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class StorageXML
|
4
4
|
module Utils
|
5
5
|
# https://cloud.google.com/storage/docs/access-control#predefined-acl
|
6
|
-
VALID_ACLS =
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
VALID_ACLS = %w(
|
7
|
+
authenticated-read
|
8
|
+
bucket-owner-full-control
|
9
|
+
bucket-owner-read
|
10
|
+
private
|
11
|
+
project-private
|
12
|
+
public-read
|
13
|
+
public-read-write
|
14
|
+
).freeze
|
15
15
|
|
16
16
|
def http_url(params, expires)
|
17
17
|
"http://" << host_path_query(params, expires)
|
@@ -22,7 +22,7 @@ module Fog
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def url(params, expires)
|
25
|
-
Fog::Logger.deprecation("Fog::Storage
|
25
|
+
Fog::Logger.deprecation("Fog::Google::Storage => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
|
26
26
|
https_url(params, expires)
|
27
27
|
end
|
28
28
|
|
@@ -46,7 +46,7 @@ module Fog
|
|
46
46
|
|
47
47
|
def request_params(params)
|
48
48
|
subdomain = params[:host].split(".#{@host}").first
|
49
|
-
if @path_style || subdomain !~ /^(?!goog)(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![
|
49
|
+
if @path_style || subdomain !~ /^(?!goog)(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![.-])|-(?!\.)){1,61}[a-z0-9]$/
|
50
50
|
if subdomain =~ /_/
|
51
51
|
# https://github.com/fog/fog/pull/1258#issuecomment-10248620.
|
52
52
|
Fog::Logger.warning("fog: the specified google storage bucket name (#{subdomain}) is not DNS compliant (only characters a through z, digits 0 through 9, and the hyphen).")
|
@@ -61,12 +61,13 @@ module Fog
|
|
61
61
|
end
|
62
62
|
|
63
63
|
params[:host] = params[:host].split("#{subdomain}.")[-1]
|
64
|
-
params[:path]
|
65
|
-
|
64
|
+
if params[:path]
|
65
|
+
params[:path] =
|
66
66
|
"#{subdomain}/#{params[:path]}"
|
67
|
-
|
67
|
+
else
|
68
|
+
params[:path] =
|
68
69
|
subdomain.to_s
|
69
|
-
|
70
|
+
end
|
70
71
|
|
71
72
|
subdomain = nil
|
72
73
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
4
|
-
autoload :Mock,
|
5
|
-
autoload :Real,
|
6
|
-
autoload :Utils,
|
2
|
+
module Google
|
3
|
+
class StorageXML < Fog::Service
|
4
|
+
autoload :Mock, "fog/google/storage/storage_xml/mock"
|
5
|
+
autoload :Real, "fog/google/storage/storage_xml/real"
|
6
|
+
autoload :Utils, "fog/google/storage/storage_xml/utils"
|
7
7
|
|
8
8
|
requires :google_storage_access_key_id, :google_storage_secret_access_key
|
9
9
|
recognizes :host, :port, :scheme, :persistent, :path_style
|
10
10
|
|
11
|
-
model_path "fog/storage/
|
11
|
+
model_path "fog/google/storage/storage_xml/models"
|
12
12
|
collection :directories
|
13
13
|
model :directory
|
14
14
|
collection :files
|
15
15
|
model :file
|
16
16
|
|
17
|
-
request_path "fog/storage/
|
17
|
+
request_path "fog/google/storage/storage_xml/requests"
|
18
18
|
request :copy_object
|
19
19
|
request :delete_bucket
|
20
20
|
request :delete_object
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
2
|
+
module Google
|
3
|
+
class Storage < Fog::Service
|
4
4
|
def self.new(options = {})
|
5
5
|
begin
|
6
6
|
fog_creds = Fog.credentials
|
7
|
-
rescue
|
7
|
+
rescue StandardError
|
8
8
|
fog_creds = nil
|
9
9
|
end
|
10
10
|
|
11
11
|
if options.keys.include?(:google_storage_access_key_id) ||
|
12
12
|
(!fog_creds.nil? && fog_creds.keys.include?(:google_storage_access_key_id))
|
13
|
-
Fog::
|
13
|
+
Fog::Google::StorageXML.new(options)
|
14
14
|
else
|
15
|
-
Fog::
|
15
|
+
Fog::Google::StorageJSON.new(options)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/fog/google/version.rb
CHANGED
data/lib/fog/google.rb
CHANGED
@@ -4,20 +4,17 @@ require "fog/xml"
|
|
4
4
|
require "fog/google/version"
|
5
5
|
|
6
6
|
module Fog
|
7
|
-
module Compute
|
8
|
-
autoload :Google, File.expand_path("../compute/google", __FILE__)
|
9
|
-
end
|
10
|
-
|
11
|
-
module DNS
|
12
|
-
autoload :Google, File.expand_path("../dns/google", __FILE__)
|
13
|
-
end
|
14
|
-
|
15
7
|
module Google
|
8
|
+
autoload :Compute, File.expand_path("../google/compute", __FILE__)
|
9
|
+
autoload :DNS, File.expand_path("../google/dns", __FILE__)
|
16
10
|
autoload :Mock, File.expand_path("../google/mock", __FILE__)
|
17
11
|
autoload :Monitoring, File.expand_path("../google/monitoring", __FILE__)
|
18
12
|
autoload :Pubsub, File.expand_path("../google/pubsub", __FILE__)
|
19
13
|
autoload :Shared, File.expand_path("../google/shared", __FILE__)
|
20
14
|
autoload :SQL, File.expand_path("../google/sql", __FILE__)
|
15
|
+
autoload :Storage, File.expand_path("../google/storage", __FILE__)
|
16
|
+
autoload :StorageJSON, 'fog/google/storage/storage_json'
|
17
|
+
autoload :StorageXML, 'fog/google/storage/storage_xml'
|
21
18
|
|
22
19
|
extend Fog::Provider
|
23
20
|
|
@@ -37,17 +34,34 @@ module Fog
|
|
37
34
|
"%" + Regexp.last_match(1).unpack("H2" * Regexp.last_match(1).bytesize).join("%").upcase
|
38
35
|
end
|
39
36
|
end
|
40
|
-
end
|
41
37
|
|
42
|
-
|
43
|
-
|
44
|
-
autoload :Google, File.expand_path("../parsers/storage/google", __FILE__)
|
38
|
+
module Parsers
|
39
|
+
autoload :Storage, 'fog/google/parsers/storage'
|
45
40
|
end
|
46
41
|
end
|
42
|
+
end
|
47
43
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
# Add shims for backward compatibility
|
45
|
+
# This allows old style references like Fog::Compute::Google to work
|
46
|
+
# by redirecting them to the new namespace Fog::Google::Compute
|
47
|
+
|
48
|
+
module Fog
|
49
|
+
# List of services from the original module
|
50
|
+
GOOGLE_SERVICES = %w[Compute DNS Monitoring Pubsub Storage SQL]
|
51
|
+
|
52
|
+
# Dynamically create shim modules for each service
|
53
|
+
GOOGLE_SERVICES.each do |service|
|
54
|
+
# Create the module namespace
|
55
|
+
const_set(service, Module.new) unless const_defined?(service)
|
56
|
+
|
57
|
+
# Get reference to the module
|
58
|
+
service_module = const_get(service)
|
59
|
+
|
60
|
+
# Define the Google submodule with the shim
|
61
|
+
service_module.const_set(:Google, Module.new)
|
62
|
+
service_module::Google.define_singleton_method(:new) do |*args|
|
63
|
+
warn "[DEPRECATION] `Fog::#{service}::Google.new` is deprecated. Please use `Fog::Google::#{service}.new` instead."
|
64
|
+
Fog::Google.const_get(service).new(*args)
|
65
|
+
end
|
52
66
|
end
|
53
67
|
end
|
@@ -4,7 +4,7 @@ class TestComputeClient < FogIntegrationTest
|
|
4
4
|
def test_client_options
|
5
5
|
# XXX This is a very rudimentary test checking that proxy option is applied
|
6
6
|
client_options = { proxy_url: "https://user:password@host:8080" }
|
7
|
-
connection = Fog::Compute
|
7
|
+
connection = Fog::Google::Compute.new(google_client_options: client_options)
|
8
8
|
|
9
9
|
err = assert_raises(ArgumentError) { connection.servers.all }
|
10
10
|
assert_match(/unsupported proxy/, err.message)
|
@@ -36,10 +36,10 @@ class TestDisks < FogIntegrationTest
|
|
36
36
|
|
37
37
|
snapshot = disk.create_snapshot("fog-test-snapshot")
|
38
38
|
|
39
|
-
assert(snapshot.is_a?(Fog::Compute::
|
39
|
+
assert(snapshot.is_a?(Fog::Google::Compute::Snapshot),
|
40
40
|
"Resulting snapshot should be a snapshot object.")
|
41
41
|
|
42
|
-
assert_raises(ArgumentError) { snapshot.set_labels(
|
42
|
+
assert_raises(ArgumentError) { snapshot.set_labels(%w(bar test)) }
|
43
43
|
|
44
44
|
snapshot.set_labels(foo: "bar", fog: "test")
|
45
45
|
|
@@ -4,7 +4,7 @@ require "base64"
|
|
4
4
|
|
5
5
|
class TestComputeSnapshots < FogIntegrationTest
|
6
6
|
def setup
|
7
|
-
@client = Fog::Compute
|
7
|
+
@client = Fog::Google::Compute.new
|
8
8
|
# Ensure any resources we create with test prefixes are removed
|
9
9
|
Minitest.after_run do
|
10
10
|
delete_test_resources
|