diff --git a/.fog.example b/.fog.example index 3779e753a1..f2f8d97df1 100644 --- a/.fog.example +++ b/.fog.example @@ -15,10 +15,8 @@ # 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. + # 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/.travis.yml b/.travis.yml index da225d3415..7ea57ae6d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,10 @@ dist: trusty matrix: fast_finish: true include: - - rvm: 2.1 - - rvm: 2.2 - 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..502f4fc948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,84 @@ 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 + +## 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 + +#### 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 + +#### 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 + +- \#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 + - Remove EOL versions of ruby from Travis + - Consolidated logic of `Disk.get_as_boot_disk` and increase doc coverage of + disk-associated methods. + - Add a guard a guard method for `Snapshot.add_labels` + ## 1.8.1 ### User-facing @@ -260,8 +338,6 @@ We encourage people using 0.5.1 to upgrade. ## Template to use -## Next release - ### User-facing #### Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef45ddd974..d14c6236d1 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: @@ -77,14 +77,14 @@ $ inch show Fog::Compute::Google::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. @@ -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 ``` @@ -138,7 +137,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 +158,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 +170,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/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/README.md b/README.md index bc557681a5..db3ddad307 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). @@ -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 @@ -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 +=> [ 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 -=> [ [ /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,14 +22,23 @@ echo $google_json_key_data > `pwd`/service_account_key.json cat >~/.fog < /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 78e619aa1b..ea6dd4b679 100644 --- a/ci/tasks/run-int.yml +++ b/ci/tasks/run-int.yml @@ -8,9 +8,11 @@ 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 google_project: replace-me - google_client_email: replace-me google_json_key_data: | replace-me \ No newline at end of file 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 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/fog-google.gemspec b/fog-google.gemspec index 42d4fa2432..0efdd48b51 100644 --- a/fog-google.gemspec +++ b/fog-google.gemspec @@ -20,17 +20,15 @@ Gem::Specification.new do |spec| # As of 0.1.1 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" 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" # Testing gems spec.add_development_dependency "retriable" diff --git a/lib/fog/bin/google.rb b/lib/fog/bin/google.rb index 5c2b47513b..cb70025af1 100644 --- a/lib/fog/bin/google.rb +++ b/lib/fog/bin/google.rb @@ -4,15 +4,15 @@ class << self def class_for(key) case key when :compute - Fog::Compute::Google + Fog::Google::Compute when :dns - Fog::DNS::Google + Fog::Google::DNS 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 3281ee1b35..4521266cd2 100644 --- a/lib/fog/google.rb +++ b/lib/fog/google.rb @@ -4,20 +4,17 @@ require "fog/google/version" module Fog - module Compute - autoload :Google, File.expand_path("../compute/google", __FILE__) - end - - module DNS - autoload :Google, File.expand_path("../dns/google", __FILE__) - end - module Google - 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 :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 @@ -37,17 +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 - - 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/compute/google.rb b/lib/fog/google/compute/compute.rb similarity index 96% rename from lib/fog/compute/google.rb rename to lib/fog/google/compute/compute.rb index 89c083e281..34bc2c8d5d 100644 --- a/lib/fog/compute/google.rb +++ b/lib/fog/google/compute/compute.rb @@ -1,16 +1,16 @@ module Fog - module Compute - class Google < Fog::Service - autoload :Mock, File.expand_path("../google/mock", __FILE__) - autoload :Real, File.expand_path("../google/real", __FILE__) + module Google + class Compute < Fog::Service + autoload :Mock, "fog/google/compute/mock" + autoload :Real, "fog/google/compute/real" requires :google_project recognizes( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_extra_global_projects, :google_key_location, @@ -31,7 +31,7 @@ class Google < Fog::Service PROVISIONING = "PROVISIONING".freeze STAGING = "STAGING".freeze - request_path "fog/compute/google/requests" + request_path "fog/google/compute/requests" request :add_backend_service_backends request :add_instance_group_instances request :add_server_access_config @@ -212,7 +212,7 @@ class Google < Fog::Service request :deprecate_image - model_path "fog/compute/google/models" + model_path "fog/google/compute/models" model :server collection :servers diff --git a/lib/fog/compute/google/mock.rb b/lib/fog/google/compute/mock.rb similarity index 99% rename from lib/fog/compute/google/mock.rb rename to lib/fog/google/compute/mock.rb index 100d922ae2..0c18cd809d 100644 --- a/lib/fog/compute/google/mock.rb +++ b/lib/fog/google/compute/mock.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute class Mock include Fog::Google::Shared attr_reader :extra_global_projects diff --git a/lib/fog/compute/google/models/address.rb b/lib/fog/google/compute/models/address.rb similarity index 76% rename from lib/fog/compute/google/models/address.rb rename to lib/fog/google/compute/models/address.rb index d03d60cd27..37adc05983 100755 --- a/lib/fog/compute/google/models/address.rb +++ b/lib/fog/google/compute/models/address.rb @@ -1,6 +1,6 @@ module Fog - module Compute - class Google + module Google + class Compute ## # Represents an Address resource # @@ -37,7 +37,7 @@ def save requires :identity, :region data = service.insert_address(identity, region, attributes) - operation = Fog::Compute::Google::Operations + operation = Fog::Google::Compute::Operations .new(:service => 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) @@ -74,19 +74,32 @@ 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( 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 end - def disassociate + # 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 return nil if !in_use? || users.nil? || users.empty? @@ -107,7 +120,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 59% rename from lib/fog/compute/google/models/disk.rb rename to lib/fog/google/compute/models/disk.rb index f00df2be33..f0e74a78b0 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 @@ -68,19 +68,51 @@ 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) 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) - { - :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? @@ -106,7 +138,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 54% rename from lib/fog/compute/google/models/disks.rb rename to lib/fog/google/compute/models/disks.rb index d7fe166e88..41768aa03a 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) @@ -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, 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 87% rename from lib/fog/compute/google/models/snapshot.rb rename to lib/fog/google/compute/models/snapshot.rb index 95fed83062..fe421e7bcc 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 @@ -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 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/dns/google.rb b/lib/fog/google/dns/dns.rb similarity index 80% rename from lib/fog/dns/google.rb rename to lib/fog/google/dns/dns.rb index 1407c348a3..9f2a952fc1 100644 --- a/lib/fog/dns/google.rb +++ b/lib/fog/google/dns/dns.rb @@ -1,16 +1,16 @@ 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( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, @@ -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/monitoring.rb b/lib/fog/google/monitoring.rb index 93af09c560..653c0c08ff 100644 --- a/lib/fog/google/monitoring.rb +++ b/lib/fog/google/monitoring.rb @@ -1,15 +1,16 @@ 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( :app_name, :app_version, + :google_application_default, + :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, 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..d275ef1410 --- /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/pubsub.rb b/lib/fog/google/pubsub.rb index 30e50b40fc..138119bd72 100644 --- a/lib/fog/google/pubsub.rb +++ b/lib/fog/google/pubsub.rb @@ -1,16 +1,16 @@ 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( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_json_key_location, :google_json_key_string, diff --git a/lib/fog/google/shared.rb b/lib/fog/google/shared.rb index e26d9704a5..768bb7f489 100644 --- a/lib/fog/google/shared.rb +++ b/lib/fog/google/shared.rb @@ -20,16 +20,13 @@ 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_client_email A @developer.gserviceaccount.com email address 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 @@ -39,36 +36,18 @@ 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/dns_#{Fog::DNS::Google::GOOGLE_DNS_API_VERSION}" + require "google/apis/compute_#{Fog::Google::Compute::GOOGLE_COMPUTE_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}" + 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") 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 - - # 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? @@ -78,41 +57,21 @@ def initialize_google_client(options) ::Google::Apis::ClientOptions.default.application_name = application_name ::Google::Apis::ClientOptions.default.application_version = Fog::Google::VERSION - 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 - - options[:google_client_email] = json_key_hash["client_email"] - unless options[:google_client_email] - 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 - if ENV["DEBUG"] - ::Google::Apis.logger = ::Logger.new(::STDERR) - ::Google::Apis.logger.level = ::Logger::DEBUG - end + auth = nil - 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[:google_application_default] + auth = process_application_default_auth(options) else - raise ArgumentError.new( - "Missing required arguments: google_json_key_location, "\ - "google_json_key_string or google_auth" - ) + auth = process_fallback_auth(options) end ::Google::Apis::RequestOptions.default.authorization = auth @@ -188,6 +147,102 @@ 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) + ::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 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." \ + ) + 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 diff --git a/lib/fog/google/sql.rb b/lib/fog/google/sql.rb index bfa7fd9bc6..788a3d95d8 100644 --- a/lib/fog/google/sql.rb +++ b/lib/fog/google/sql.rb @@ -1,16 +1,16 @@ 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( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, 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 80% rename from lib/fog/storage/google_json.rb rename to lib/fog/google/storage/storage_json.rb index def098ff01..2dda9e358a 100644 --- a/lib/fog/storage/google_json.rb +++ b/lib/fog/google/storage/storage_json.rb @@ -1,17 +1,17 @@ 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( :app_name, :app_version, + :google_application_default, :google_auth, :google_client, - :google_client_email, :google_client_options, :google_key_location, :google_key_string, @@ -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 97% 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..1487573e1e 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 @@ -68,6 +68,8 @@ def get_object(bucket_name, object_name, end object + ensure + buf.close! rescue nil end end 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..3a24e74b0e 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 96% 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..7fa8a60524 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 # @@ -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/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 97% 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..5705c91a79 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 # @@ -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/storage/google_xml/requests/get_bucket_acl.rb b/lib/fog/google/storage/storage_xml/requests/get_bucket_acl.rb similarity index 94% 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..d46d01c90a 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 # @@ -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/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 95% 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..e67cdee122 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 # @@ -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/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 92% 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..14c7ba1f55 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 # @@ -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/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/lib/fog/google/version.rb b/lib/fog/google/version.rb index 6e1b3d6387..9c6a046e2d 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.9.1".freeze 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 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 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..c642f2a812 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -5,7 +5,49 @@ class TestDisks < FogIntegrationTest include TestCollection def setup - @subject = Fog::Compute[:google].disks + @subject = Fog::Google::Compute.new.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 + + 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 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..3a289583b5 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 @@ -32,6 +32,29 @@ 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" + ) + + address.server = server + address.reload + assert_equal( + server, + address.server, + "Address should be associated with a server after association" + ) end def test_bad_get 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/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")', 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/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 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 diff --git a/test/unit/storage/test_json_requests.rb b/test/unit/storage/test_json_requests.rb index 1d4d87475a..ffe190db48 100644 --- a/test/unit/storage/test_json_requests.rb +++ b/test/unit/storage/test_json_requests.rb @@ -3,10 +3,9 @@ class UnitTestJsonRequests < MiniTest::Test def setup Fog.mock! - @client = Fog::Storage.new(provider: "google", - google_client_email: "", - google_project: "", - google_json_key_location: "") + @client = Fog::Google::Storage.new(google_client_email: "", + google_project: "", + google_json_key_location: "") end def teardown 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