Sha256: 88f83f20cc7d4ad3ab75cf7c9437bc799de324463fc5734cca08076918221959

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

module Fog
  module AWS
    class EC2

      class SecurityGroup < Fog::Model

        attribute :group_description, 'groupDescription'
        attribute :group_name,        'groupName'
        attribute :ip_permissions,    'ipPermissions'
        attribute :owner_id,          'ownerId'

        def destroy
          connection.delete_security_group(@group_name)
          true
        end

        def reload
          if new_security_group = security_groups.get(@group_name)
            merge_attributes(new_security_group.attributes)
          end
        end

        def save
          data = connection.create_security_group(@group_name, @group_description).body
          true
        end

        def security_groups
          @security_groups
        end

        private

        def security_groups=(new_security_groups)
          @security_groups = new_security_groups
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-0.0.27 lib/fog/aws/models/ec2/security_group.rb
fog-0.0.26 lib/fog/aws/models/ec2/security_group.rb