Sha256: 8fea79064e5800c0c288d478cf4f41312dd9bcd0f91244c6d926ceb817c0c633

Contents?: true

Size: 1.7 KB

Versions: 23

Compression:

Stored size: 1.7 KB

Contents

module AWS
  module EC2

    class Base < AWS::Base

      # The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
      #
      # @option options [Array] :snapshot_id ([])
      #
      def describe_snapshots( options = {} )

        options = { :snapshot_id => [] }.merge(options)

        params = pathlist("SnapshotId", options[:snapshot_id] )

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

      end

      # The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance.
      #
      # @option options [String] :volume_id ('')
      #
      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


      # The DeleteSnapshot operation deletes a snapshot of an Amazon EBS  volume that is stored in Amazon S3.
      #
      # @option options [String] :snapshot_id ('')
      #
      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
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
grempe-amazon-ec2-0.5.2 lib/AWS/EC2/snapshots.rb
grempe-amazon-ec2-0.5.3 lib/AWS/EC2/snapshots.rb
grempe-amazon-ec2-0.5.4 lib/AWS/EC2/snapshots.rb
grempe-amazon-ec2-0.5.5 lib/AWS/EC2/snapshots.rb
newrelic-amazon-ec2-0.6.2 lib/AWS/EC2/snapshots.rb
poolparty-1.4.6 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
poolparty-1.4.5 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
poolparty-1.4.4 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
poolparty-1.4.3 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
poolparty-1.4.2 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
poolparty-1.4.1 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
amazon-ec2-0.7.3 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.7.2 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.7.1 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.7.0 lib/AWS/EC2/snapshots.rb
poolparty-1.4.0 vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb
amazon-ec2-0.6.2 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.6.1 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.6.0 lib/AWS/EC2/snapshots.rb
amazon-ec2-0.5.5 lib/AWS/EC2/snapshots.rb