Sha256: be306bec901459b0ff3b9da949c5c0f76c011e287993c1c3bf59abe023afdeb2

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

module Fog
  module AWS
    module EC2
      class Real

        # Delete a snapshot of an EBS volume that you own
        #
        # ==== Parameters
        # * snapshot_id<~String> - ID of snapshot to delete
        # ==== Returns
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'requestId'<~String> - Id of request
        #     * 'return'<~Boolean> - success?
        def delete_snapshot(snapshot_id)
          request(
            'Action'      => 'DeleteSnapshot',
            'SnapshotId'  => snapshot_id,
            :parser       => Fog::Parsers::AWS::EC2::Basic.new
          )
        end

      end

      class Mock

        def delete_snapshot(snapshot_id)
          response = Excon::Response.new
          if snapshot = @data[:snapshots].delete(snapshot_id)
            response.status = true
            response.body = {
              'requestId' => Fog::AWS::Mock.request_id,
              'return'    => true
            }
          else
            response.status = 400
            raise(Excon::Errors.status_error({:expects => 200}, response))
          end
          response
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-0.0.76 lib/fog/aws/requests/ec2/delete_snapshot.rb
fog-0.0.75 lib/fog/aws/requests/ec2/delete_snapshot.rb
fog-0.0.74 lib/fog/aws/requests/ec2/delete_snapshot.rb
fog-0.0.73 lib/fog/aws/requests/ec2/delete_snapshot.rb