1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|compute] added security group get by id method

This commit is contained in:
bdorry 2011-09-07 11:10:20 -04:00
parent a699f848e6
commit f0f24772d1

View file

@ -88,6 +88,28 @@ module Fog
end
end
# Used to retreive a security group
# group id is required to get the associated flavor information.
#
# You can run the following command to get the details:
# AWS.security_groups.get_by_id("default")
#
# ==== Returns
#
#>> AWS.security_groups.get_by_id("sg-123456")
# <Fog::AWS::Compute::SecurityGroup
# name="default",
# description="default group",
# ip_permissions=[{"groups"=>[{"groupName"=>"default", "userId"=>"312571045469"}], "fromPort"=>-1, "toPort"=>-1, "ipRanges"=>[], "ipProtocol"=>"icmp"}, {"groups"=>[{"groupName"=>"default", "userId"=>"312571045469"}], "fromPort"=>0, "toPort"=>65535, "ipRanges"=>[], "ipProtocol"=>"tcp"}, {"groups"=>[{"groupName"=>"default", "userId"=>"312571045469"}], "fromPort"=>0, "toPort"=>65535, "ipRanges"=>[], "ipProtocol"=>"udp"}],
# owner_id="312571045469"
# >
#
def get_by_id(group_id)
if group_id
self.class.new(:connection => connection).all('group-id' => group_id).first
end
end
end
end