Sha256: 1f02a52991f36bbbb3dede02aa8f41c56bb51f3e2e0a50a64ae3fe8028ff36a1

Contents?: true

Size: 919 Bytes

Versions: 14

Compression:

Stored size: 919 Bytes

Contents

module Fog
  module Compute
    class Google
      class Mock
        def get_zone(zone_name)
          zone = data[:zones][zone_name] || {
            "error" => {
              "errors" => [
                {
                  "domain" => "global",
                  "reason" => "notFound",
                  "message" => "The resource 'projects/#{project}/zones/#{zone_name}' was not found"
                }
              ],
              "code" => 404,
              "message" => "The resource 'projects/#{project}/zones/#{zone_name}' was not found"
            }
          }
          build_excon_response(zone)
        end
      end

      class Real
        def get_zone(zone_name)
          api_method = @compute.zones.get
          parameters = {
            "project" => @project,
            "zone" => zone_name
          }

          request(api_method, parameters)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.5 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.4 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.3 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.2 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.1 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.5.0 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.4.2 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.4.1 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.4.0 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.3.2 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.3.1 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.3.0 lib/fog/compute/google/requests/get_zone.rb
fog-google-0.2.0 lib/fog/compute/google/requests/get_zone.rb