Sha256: 04831e630da8de5c5a34f3e136b50a2130581eba6a4082cc1808e21b516c02a9

Contents?: true

Size: 568 Bytes

Versions: 13

Compression:

Stored size: 568 Bytes

Contents

require 'fog/core/collection'
require 'fog/cloudsigma/models/snapshot'

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

        def all
          resp = service.list_snapshots
          data = resp.body['objects']
          load(data)
        end

        def get(snap_id)
          resp = service.get_snapshot(snap_id)
          data = resp.body
          new(data)
        rescue Fog::CloudSigma::Errors::NotFound
          return nil
        end
      end
    end
  end
end

Version data entries

13 entries across 11 versions & 3 rubygems

Version Path
fog-2.3.0 lib/fog/cloudsigma/models/snapshots.rb
fog-ifeel-2.2.0 lib/fog/cloudsigma/models/snapshots.rb
fog-2.2.0 lib/fog/cloudsigma/models/snapshots.rb
fog-2.1.0 lib/fog/cloudsigma/models/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudsigma/models/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudsigma/models/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudsigma/models/snapshots.rb
fog-1.42.1 lib/fog/cloudsigma/models/snapshots.rb
fog-2.0.0 lib/fog/cloudsigma/models/snapshots.rb
fog-1.42.0 lib/fog/cloudsigma/models/snapshots.rb
fog-1.41.0 lib/fog/cloudsigma/models/snapshots.rb
fog-1.40.0 lib/fog/cloudsigma/models/snapshots.rb
fog-1.39.0 lib/fog/cloudsigma/models/snapshots.rb