Sha256: cffa1720d0b3bcbdd0f6121bb7e8275c8fb89b3d651881ac792ce082814b0df3

Contents?: true

Size: 536 Bytes

Versions: 23

Compression:

Stored size: 536 Bytes

Contents

module Fog
  module Compute
    class Google
      class Networks < Fog::Collection
        model Fog::Compute::Google::Network

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

        def get(identity)
          if identity
            network = service.get_network(identity).to_h
            return new(network)
          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/networks.rb
fog-google-1.8.1 lib/fog/compute/google/models/networks.rb
fog-google-1.8.0 lib/fog/compute/google/models/networks.rb