Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyo

ó
¡ôXc@sŽddlZddlmZmZddlmZddlmZmZdefd„ƒYZ	de	fd„ƒYZ
d	e	fd
„ƒYZdS(iÿÿÿÿN(tArgtMutuallyExclusiveArgList(t
ArgumentError(t
EC2Requesttparse_portst_ModifyNetworkAclEntrycBsaeZdZedddddƒedddd	dd
dededd
ƒeedddddddddƒedddddddddƒƒjƒedddddddeddƒeddddd d!dd"ƒed#dd$dd%dd&ƒed'd(dd)dd*d+d5dd,ƒed-d.dd/dd0d+d5dd1ƒgZ	d2„Z
d3„Zd4„ZRS(6s Modify a network ACL entry

This is not an actual EC2 request -- see euca-create-network-acl-entry(1) or euca-replace-network-acl-entry(1) for something usable.tNetworkAclIdtmetavartNACLthelps4ID of the network ACL to add the entry to (required)s-ns
--rule-numbertdestt
RuleNumbertINTtrequiredttypes(rule number for the new entry (required)s--allowt
RuleActiontactiontstore_consttconsttallows/make the new entry allow the traffic it matchess--denytdenys/make the new entry block the traffic it matchess-rs--cidrt	CidrBlocktCIDRs5CIDR address range the entry should affect (required)s-Ps
--protocoltProtocoltdefaults-1s1protocol the entry should apply to (default: all)s--egresstEgresst
store_truestmake the entry affect outgoing (egress) network
                traffic (default: affect incoming (ingress) traffic)s-ps--port-ranget
port_rangetRANGEtroute_tosjrange of ports (specified as "from-to")
                or a single port number (required for tcp and udp)s-ts--icmp-type-codeticmp_type_codes	TYPE:CODEsQICMP type and
                code (specified as "type:code") (required for icmp)cCs|jƒdS(N(tprocess_port_cli_args(tself((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pytprocess_cli_argsCscCsXtj|ƒ|jjdƒs/t|jd<n|jjdƒpDd}yt|ƒ|jd<Wnytk
rÙ|jƒdkrd|jd<qÚyt	j
|ƒ|jd<WqÚt	jk
rÕtdj
|ƒƒ‚qÚXnXt||jjdƒ|jjdƒƒ\}}|jddkr:||jd	<||jd
<n||jd<||jd<dS(
NRRiÿÿÿÿtalls1argument -n/--rule-number: unknown protocol "{0}"RRis	Icmp.Types	Icmp.CodesPortRange.FromsPortRange.To(Rt	configuretparamstgettFalsetargstintt
ValueErrortlowertsockettgetprotobynameterrorRtformatR(R tprotot	from_porttto_port((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyR#Fs*

	

cCs|jjdƒrd}nd}|jd}idd6dd6d	d
6dd6d
d6}y"|jt|ƒt|ƒƒ}Wntk
rŒnX|jd||jjdƒ|jjdƒ|jjdƒ||jjdƒpê|jjdƒ|jjdƒp|jjdƒfƒGHdS(NRtegresstingressRR"iÿÿÿÿticmpittcpitudpitsctpi„tENTRYRRRs	Icmp.TypesPortRange.Froms	Icmp.CodesPortRange.To(R'R%R$R(R)ttabify(R t_t	directiontprotocoltport_map((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pytprint_result_s	
)"
!N(
t__name__t
__module__tDESCRIPTIONRtTrueR(RR
tNonetARGSR!R#R>(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyR"s:		tCreateNetworkAclEntrycBseZdZRS(s'Create a new entry in a VPC network ACL(R?R@RA(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyREsstReplaceNetworkAclEntrycBseZdZRS(s%Replace an entry in a VPC network ACL(R?R@RA(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyRFws(R+trequestbuilderRRtrequestbuilder.exceptionsRteuca2ools.commands.ec2RRRRERF(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifynetworkaclentry.pyt<module>sQ
Back to Directory File Manager