Sha256: dfefe016ee49833fae9a42c22c1144d2cde1ae5c95a2e2cdc4a0586f68b6f635

Contents?: true

Size: 507 Bytes

Versions: 10

Compression:

Stored size: 507 Bytes

Contents

module Fog
  module Compute
    class Google
      class Snapshots < Fog::Collection
        model Fog::Compute::Google::Snapshot

        def all
          data = service.list_snapshots
          snapshots = data.body["items"] || []
          load(snapshots)
        end

        def get(snap_id)
          response = service.get_snapshot(snap_id)
          return nil if response.nil?
          new(response.body)
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fog-google-0.5.2 lib/fog/compute/google/models/snapshots.rb
fog-google-0.5.1 lib/fog/compute/google/models/snapshots.rb
fog-google-0.5.0 lib/fog/compute/google/models/snapshots.rb
fog-google-0.4.2 lib/fog/compute/google/models/snapshots.rb
fog-google-0.4.1 lib/fog/compute/google/models/snapshots.rb
fog-google-0.4.0 lib/fog/compute/google/models/snapshots.rb
fog-google-0.3.2 lib/fog/compute/google/models/snapshots.rb
fog-google-0.3.1 lib/fog/compute/google/models/snapshots.rb
fog-google-0.3.0 lib/fog/compute/google/models/snapshots.rb
fog-google-0.2.0 lib/fog/compute/google/models/snapshots.rb