Sha256: 8866ea9f2d8d8434df755e0f198943e2e14a60ebf7a2faf77350a8a85d6e5016

Contents?: true

Size: 565 Bytes

Versions: 13

Compression:

Stored size: 565 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
          data = service.list_snapshots["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

13 entries across 13 versions & 3 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.24.0 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.11 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.10 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.9 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.8 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.7 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.6 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.23.0 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.4 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.3 lib/fog/cloudstack/models/compute/snapshots.rb
ns-fog-1.22.2 lib/fog/cloudstack/models/compute/snapshots.rb
fog-1.22.1 lib/fog/cloudstack/models/compute/snapshots.rb