ó ¡ôXc@sFddlmZddlmZmZmZdefd„ƒYZdS(iÿÿÿÿ(t EC2Request(tArgtFiltertGenericTagFiltertDescribeSecurityGroupscBsIeZdZeddddddd/dgdd ƒgZed dd ƒed ƒed ƒedddƒedddƒedddƒedddƒedddƒedddƒedddƒedddƒedddƒed dd!ƒed"dd#ƒed$dd%ƒgZd&d'd(d)d*d+gZ d,„Z d-„Z d.„Z RS(0s¿Show information about security groups Note that filters are matched on literal strings only, so "--filter ip-permission.from-port=22" will *not* match a group with a port range of 20 to 30.tgrouptmetavartGROUPtnargst*troute_totdefaultthelps)limit results to specific security groupst descriptionsgroup descriptionsgroup-ids group-namesip-permission.cidrs-CIDR IP range granted permission by the groupsip-permission.from-ports0start of TCP/UDP port range, or ICMP type numbersip-permission.group-namesLname of another group granted permission by this groupsip-permission.group-idsJID of another group granted permission by this groupsip-permission.protocolsIP protocol for the permissionsip-permission.to-ports'end of TCP/UDP port range, or ICMP codesip-permission.user-ids#ID of an account granted permissionsowner-idsaccount ID of the group's ownerstag-keys"key of a tag assigned to the groups tag-values$value of a tag assigned to the groupstag:KEYs"specific tag key/value combinationsvpc-ids+[VPC only] ID of a VPC the group belongs totsecurityGroupInfot ipPermissionstipPermissionsEgresstgroupstipRangesttagSetcCs|xu|jdD]f}|jdƒrM|jjdgƒ|jdj|ƒq|jjdgƒ|jdj|ƒqWdS(NRssg-tGroupIdt GroupName(targst startswithtparamst setdefaulttappend(tselfR((sQ/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/describesecuritygroups.pyt preprocessAs cCs.x'|jdgƒD]}|j|ƒqWdS(NR(tgett print_group(RtresultR((sQ/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/describesecuritygroups.pyt print_resultJsc Cs@|jd|jdƒ|jdƒ|jdƒ|jdƒ|jdƒfƒGHxR|jdgƒD]>}d|jdƒ|jdƒd |jd ƒ|jd ƒ|jd ƒg}xG|jd gƒD]3}dd|jdƒdg}|j||ƒGHqÁWx£|jdgƒD]}dd|jdƒg}|jdƒrR|jd|dgƒn|jdƒr{|jd|dgƒn|jdƒ|j||ƒGHq Wq`WxR|jdgƒD]>}d|jdƒ|jdƒd |jd ƒ|jd ƒ|jd ƒg}xG|jd gƒD]3}dd|jdƒdg}|j||ƒGHqWx£|jdgƒD]}dd|jdƒg}|jdƒr§|jd|dgƒn|jdƒrÐ|jd|dgƒn|jdƒ|j||ƒGHq`WqµWxB|jdgƒD].}|j||jdƒp4|jdƒƒq WdS(NRtgroupIdtownerIdt groupNametgroupDescriptiontvpcIdRt PERMISSIONtALLOWSt ipProtocoltfromPortttoPortRtFROMtCIDRtcidrIptingressRtUSERtuserIdtNAMEtIDRtTOtegressR(ttabifyRtextendRtprint_resource_tag(RRtpermt perm_baset cidr_ranget perm_itemt othergroupttag((sQ/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/describesecuritygroups.pyRNsP!     N( t__name__t __module__t DESCRIPTIONRtNonetARGSRRtFILTERSt LIST_TAGSRR R(((sQ/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/describesecuritygroups.pyRsB               N(teuca2ools.commands.ec2RtrequestbuilderRRRR(((sQ/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/describesecuritygroups.pyts