This file is indexed.

/usr/lib/ruby/vendor_ruby/AWS/EC2/snapshots.rb is in ruby-amazon-ec2 0.9.17-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
module AWS
  module EC2

    class Base < AWS::Base


      # The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
      #
      # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
      # @option options [optional,String] :owner ('') Returns snapshots owned by the specified owner. Multiple owners can be specified. Valid values self | amazon | AWS Account ID
      # @option options [optional,String] :restorable_by ('') Account ID of a user that can create volumes from the snapshot.
      #
      def describe_snapshots( options = {} )
        params = {}
        params.merge!(pathlist("SnapshotId", options[:snapshot_id] )) unless options[:snapshot_id].nil? || options[:snapshot_id] == []
        params["RestorableBy"] = options[:restorable_by] unless options[:restorable_by].nil?
        params["Owner"] = options[:owner] unless options[:owner].nil?
        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 ('')
      # @option options [optional,String] :description ('') Description of the Amazon EBS snapshot.
      #
      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]
        }
        params["Description"] = options[:description] unless options[:description].nil?
        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


      # The DescribeSnapshotAttribute operation returns information about an attribute of a snapshot. Only one attribute can be specified per call.
      #
      # @option options [String] :attribute ('createVolumePermission') Attribute to modify.
      # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
      #
      def describe_snapshot_attribute( options = {} )
        params = { "Attribute" =>  options[:attribute] || 'createVolumePermission' }
        params.merge!(pathlist("SnapshotId", options[:snapshot_id] )) unless options[:snapshot_id].nil? || options[:snapshot_id] == []
        return response_generator(:action => "DescribeSnapshotAttribute", :params => params)
      end


      # The ModifySnapshotAttribute operation adds or remove permission settings for the specified snapshot.
      #
      # @option options [String] :snapshot_id ('') The ID of the Amazon EBS snapshot.
      # @option options [String] :attribute ('createVolumePermission') Attribute to modify.
      # @option options [String] :operation_type ('') Operation to perform on the attribute.
      # @option options [optional,String] :user_id ('') Account ID of a user that can create volumes from the snapshot.
      # @option options [optional,String] :user_group ('') Group that is allowed to create volumes from the snapshot.
      #
      def modify_snapshot_attribute( options = {} )
        options = { :snapshot_id => '' }.merge(options)
        raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
        options = { :operation_type => '' }.merge(options)
        raise ArgumentError, "No :operation_type provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
	      params = {
          "Attribute" =>  options[:attribute] || 'createVolumePermission',
          "SnapshotId" => options[:snapshot_id],
          "OperationType" => options[:operation_type]
        }
        params["UserId"] = options[:user_id] unless options[:user_id].nil?
        params["UserGroup"] = options[:user_group] unless options[:user_group].nil?
        return response_generator(:action => "ModifySnapshotAttribute", :params => params)
      end


      # The ResetSnapshotAttribute operation resets permission settings for the specified snapshot.
      #
      # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
      # @option options [String] :attribute ('createVolumePermission') Attribute to reset.
      #
      def reset_snapshot_attribute( options = {} )
        options = { :snapshot_id => '' }.merge(options)
        raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
        params = { "Attribute" =>  options[:attribute] || 'createVolumePermission' }
        params["SnapshotId"] = options[:snapshot_id] unless options[:snapshot_id].nil? || options[:snapshot_id].empty?
        return response_generator(:action => "ResetSnapshotAttribute", :params => params)
      end

    end
  end
end