Sha256: 23ae32ffcede9388c9b9f5d4c73b6ddad33c79c528eaa185e92f39561e16e0ec

Contents?: true

Size: 860 Bytes

Versions: 17

Compression:

Stored size: 860 Bytes

Contents

module Fog
  module AWS
    class EC2

      class Snapshot < Fog::Model

        identity  :id, 'snapshotId'

        attribute :progress
        attribute :created_at,  'startTime'
        attribute :status
        attribute :volume_id,   'volumeId'

        def destroy
          requires :id

          connection.delete_snapshot(@id)
          true
        end

        def save
          requires :volume_id

          data = connection.create_snapshot(@volume_id).body
          new_attributes = data.reject {|key,value| key == 'requestId'}
          merge_attributes(new_attributes)
          true
        end

        def volume
          requires :id

          connection.describe_volumes(@volume_id)
        end

        private

        def volume=(new_volume)
          @volume_id = new_volume.volume_id
        end

      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fog-0.0.56 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.55 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.54 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.53 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.52 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.51 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.50 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.49 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.48 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.47 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.46 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.45 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.44 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.43 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.42 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.41 lib/fog/aws/models/ec2/snapshot.rb
fog-0.0.40 lib/fog/aws/models/ec2/snapshot.rb