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:
parent
a699f848e6
commit
f0f24772d1
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue