Sha256: 76b93fb655aafbf0389700802d75782f9d41840a73075dffedd0821c0f0e6c11
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
require 'rackspace-fog/core/collection' require 'rackspace-fog/aws/models/compute/snapshot' module Fog module Compute class AWS class Snapshots < Fog::Collection attribute :filters attribute :volume model Fog::Compute::AWS::Snapshot def initialize(attributes) self.filters ||= { 'RestorableBy' => 'self' } super end def all(filters = filters, options = {}) unless filters.is_a?(Hash) Fog::Logger.deprecation("all with #{filters.class} param is deprecated, use all('snapshot-id' => []) instead [light_black](#{caller.first})[/]") filters = {'snapshot-id' => [*filters]} end self.filters = filters data = connection.describe_snapshots(filters.merge!(options)).body load(data['snapshotSet']) if volume self.replace(self.select {|snapshot| snapshot.volume_id == volume.id}) end self end def get(snapshot_id) if snapshot_id self.class.new(:connection => connection).all('snapshot-id' => snapshot_id).first end end def new(attributes = {}) if volume super({ 'volumeId' => volume.id }.merge!(attributes)) else super end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rackspace-fog-1.4.2 | lib/rackspace-fog/aws/models/compute/snapshots.rb |