Sha256: 1f215d2f1fda164fb57fe2bcc3ea97677b74228d4a9a295d119f7abe0d43b6e2

Contents?: true

Size: 624 Bytes

Versions: 27

Compression:

Stored size: 624 Bytes

Contents

require 'fog/core/collection'
require 'fog/cloudstack/models/compute/snapshot'

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

        def all(attributes = {})
          response = service.list_snapshots(attributes)
          data = response["listsnapshotsresponse"]["snapshot"] || []
          load(data)
        end

        def get(snapshot_id)
          snapshot = service.list_snapshots('id' => snapshot_id)["listsnapshotsresponse"]["snapshot"].first
          new(snapshot) if snapshot
        end
      end
    end
  end
end

Version data entries

27 entries across 25 versions & 4 rubygems

Version Path
fog-2.1.0 lib/fog/cloudstack/models/compute/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/snapshots.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.42.1 lib/fog/cloudstack/models/compute/snapshots.rb
fog-2.0.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.42.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.41.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.40.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.39.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.38.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.37.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.36.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.35.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-2.0.0.pre.0 lib/fog/cloudstack/models/compute/snapshots.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.34.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.33.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.32.0 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.31.0 lib/fog/cloudstack/models/compute/snapshots.rb