Sha256: bfb02629ab61105a40937d8ef64197c87497c235947af57a09f32e315bb0520f

Contents?: true

Size: 1014 Bytes

Versions: 2

Compression:

Stored size: 1014 Bytes

Contents

module EC2

  class Base
    def create_snapshot( options = {} )
      options = { :volume_id => '' }.merge(options)
      raise ArgumentError, "No ':volume_id' provided" if options[:volume_id].nil? || options[:volume_id].empty?

      params = { "VolumeId" => options[:volume_id] }
      return response_generator(:action => "CreateSnapshot", :params => params)      
    end

    def describe_snapshots( options = {} )
      options = { :snapshot_id => [] }.merge(options)
      params = pathlist("SnapshotId", options[:snapshot_id])

      return response_generator(:action => "DescribeSnapshots", :params => params)
    end

    def delete_snapshot( options = {} )
      options = { :snapshot_id => '' }.merge(options)
      raise ArgumentError, "No ':snapshot_id' provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?

      params = { "SnapshotId" => options[:snapshot_id] }
      return response_generator(:action => "DeleteSnapshot", :params => params)      
    end
    
    
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
skippy-amazon-ec2-0.0.2 lib/EC2/snapshots.rb
skippy-amazon-ec2-0.2.16 lib/EC2/snapshots.rb