Sha256: a056b6dfee9e5ee49cf4f61809d13b40acedbf2ba3202d9ebdfa593dc2fd43d4

Contents?: true

Size: 1.67 KB

Versions: 101

Compression:

Stored size: 1.67 KB

Contents

module Fog
  module Compute
    class AWS
      class Real
        
        require 'fog/aws/parsers/compute/basic'

        # Modify snapshot attributes
        #
        # ==== Parameters
        # * snapshot_id<~String> - Id of snapshot to modify
        # * attributes<~Hash>:
        #   * 'Add.Group'<~Array> - One or more groups to grant volume create permission to
        #   * 'Add.UserId'<~Array> - One or more account ids to grant volume create permission to
        #   * 'Remove.Group'<~Array> - One or more groups to revoke volume create permission from
        #   * 'Remove.UserId'<~Array> - One or more account ids to revoke volume create permission from
        #
        # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifySnapshotAttribute.html]
        #
        def modify_snapshot_attribute(snapshot_id, attributes)
          params = {}
          params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Add.%d.Group', attributes['Add.Group'] || []))
          params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Add.%d.UserId', attributes['Add.UserId'] || []))
          params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Remove.%d.Group', attributes['Remove.Group'] || []))
          params.merge!(Fog::AWS.indexed_param('CreateVolumePermission.Remove.%d.UserId', attributes['Remove.UserId'] || []))
          request({
            'Action'        => 'ModifySnapshotAttribute',
            'SnapshotId'    => snapshot_id,
            :idempotent     => true,
            :parser         => Fog::Parsers::Compute::AWS::Basic.new
          }.merge!(params))
        end

      end
    end
  end
end

Version data entries

101 entries across 101 versions & 17 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-1.20.0 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-1.19.0 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/compute/modify_snapshot_attribute.rb