Sha256: b29101c6d1c88e0ca799538c853d612440a9bbfaf39e5e536fb7cbc09ab21b3b

Contents?: true

Size: 511 Bytes

Versions: 23

Compression:

Stored size: 511 Bytes

Contents

module Fog
  module Compute
    class Google
      class Zones < Fog::Collection
        model Fog::Compute::Google::Zone

        def all
          data = service.list_zones.to_h[:items] || []
          load(data)
        end

        def get(identity)
          if identity
            zone = service.get_zone(identity).to_h
            new(zone)
          end
        rescue ::Google::Apis::ClientError => e
          raise e unless e.status_code == 404
          nil
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
fog-google-1.8.2 lib/fog/compute/google/models/zones.rb
fog-google-1.8.1 lib/fog/compute/google/models/zones.rb
fog-google-1.8.0 lib/fog/compute/google/models/zones.rb