class Snapshotar::Storage::S3Storage

This snapshot storage type connects to amazon s3 via *aws-sdk gem*.

Public Instance Methods

create(filename,serialized_tree) click to toggle source

creates a snapshot specified by the given filename with data provided

Params
filename

name of the snapshot to create

serialized_tree

json serialized data

# File lib/snapshotar/storage/s3_storage.rb, line 55
def create(filename,serialized_tree)
  @bucket.objects[filename].write(serialized_tree)
end
delete(filename) click to toggle source

deletes a snapshot specified by the given filename.

Params
filename

name of the snapshot to delete

# File lib/snapshotar/storage/s3_storage.rb, line 65
def delete(filename)
  @bucket.objects[filename].delete
end
index() click to toggle source

lists available snapshots in this storage.

returns

array of filenames

# File lib/snapshotar/storage/s3_storage.rb, line 32
def index
  @bucket.objects.map{|obj| obj.key}
end
show(filename) click to toggle source

loads a snapshot specified by the given filename.

Params
filename

name of the snapshot to load

returns

still seralized json

# File lib/snapshotar/storage/s3_storage.rb, line 44
def show(filename)
  @bucket.objects[filename]
end