Method: Fog::Compute::AWS::Real#describe_security_groups

Defined in:
lib/fog/compute/requests/aws/describe_security_groups.rb

#describe_security_groups(filters = {}) ⇒ Object

Describe all or specified security groups

Parameters

  • filters<~Hash> - List of filters to limit results with

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘securityGroupInfo’<~Array>:

        • ‘groupDescription’<~String> - Description of security group

        • ‘groupName’<~String> - Name of security group

        • ‘ipPermissions’<~Array>:

          • ‘fromPort’<~Integer> - Start of port range (or -1 for ICMP wildcard)

          • ‘groups’<~Array>:

            • ‘groupName’<~String> - Name of security group

            • ‘userId’<~String> - AWS User Id of account

          • ‘ipProtocol’<~String> - Ip protocol, must be in [‘tcp’, ‘udp’, ‘icmp’]

          • ‘ipRanges’<~Array>:

            • ‘cidrIp’<~String> - CIDR range

          • ‘toPort’<~Integer> - End of port range (or -1 for ICMP wildcard)

        • ‘ownerId’<~String> - AWS Access Key Id of the owner of the security group

Amazon API Reference



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fog/compute/requests/aws/describe_security_groups.rb', line 32

def describe_security_groups(filters = {})
  unless filters.is_a?(Hash)
    Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]")
    filters = {'group-name' => [*filters]}
  end
  params = Fog::AWS.indexed_filters(filters)
  request({
    'Action'    => 'DescribeSecurityGroups',
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::DescribeSecurityGroups.new
  }.merge!(params))
end