Current 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�dkr�d|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