1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/models/ec2/security_group.rb

43 lines
925 B
Ruby
Raw Normal View History

2009-09-18 11:56:42 -04:00
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'
2009-09-20 12:21:03 -04:00
def destroy
2009-09-18 11:56:42 -04:00
connection.delete_security_group(@group_name)
true
end
2009-09-19 15:31:15 -04:00
def reload
2009-10-22 23:51:57 -04:00
if new_security_group = security_groups.get(@group_name)
merge_attributes(new_security_group.attributes)
end
2009-09-19 15:31:15 -04:00
end
2009-09-18 11:56:42 -04:00
def save
2009-09-28 23:00:49 -04:00
data = connection.create_security_group(@group_name, @group_description).body
2009-09-18 11:56:42 -04:00
true
end
def security_groups
2009-09-19 15:31:15 -04:00
@security_groups
2009-09-18 11:56:42 -04:00
end
private
def security_groups=(new_security_groups)
@security_groups = new_security_groups
end
end
end
end
end