
    3                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSKJ
r   " S S	\	R                  5      rSS
 jrS rS rSS jrS rSS jrSS jrSS jrSS jrSS jrSS jrS rg)z0Flags for the compute packet mirroring commands.    )absolute_import)division)unicode_literals)arg_parsers)
completers)flagsc                   (   ^  \ rS rSrU 4S jrSrU =r$ )PacketMirroringCompleter   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.packetMirroringsz*alpha compute packet-mirrorings list --uri)
collectionlist_command )superr
   __init__)selfkwargs	__class__s     Alib/googlecloudsdk/command_lib/compute/packet_mirrorings/flags.pyr   !PacketMirroringCompleter.__init__   s(    	
"D2 -A     r   )__name__
__module____qualname____firstlineno__r   __static_attributes____classcell__)r   s   @r   r
   r
      s     r   r
   c           	      <    [         R                  " S[        USU SS9$ )Nzpacket mirroringzpacket mirroringsr   )resource_name	completerpluralcustom_pluralrequiredregional_collection)compute_flagsResourceArgumentr
   )r$   r"   s     r   PacketMirroringArgumentr(   #   s'    		'	'&('4
6 6r   c                     [        U 5        g)z3Adds flags for creating packet mirroring resources.N_AddArgsparsers    r   AddCreateArgsr.   -   s
    
6r   c                     [        U SS9  g)z3Adds flags for updating packet mirroring resources.T)is_for_updateNr*   r,   s    r   AddUpdateArgsr1   2   s    
6&r   c                    U(       d  [        U 5        [        X5        U R                  SSS9  U R                  SSSU(       d  SOSS	9  [        X5        [	        X5        [        X5        [        X5        [        X5        [        U 5        g)
z(Adds args for create/update subcommands.z--descriptionz7Optional, textual description for the packet mirroring.helpz--enable
store_truez'Enable or disable the packet-mirroring.TN)actionr4   default)	_AddNetworkArg_AddCollectorIlbArgadd_argument_AddMirroredInstancesArg_AddMirroredTagsArg_AddMirroredSubnetsArg_AddFilterCidrRangesArg_AddFilterProtocolsArg_AddFilterDirectionArgr-   r0   s     r   r+   r+   7   s     
6f,D  F 	8'dT	  3 61f,/&0/ r   c                 &    U R                  SSSS9  g )Nz	--networkTay          Network for this packet mirroring.
        Only the packets in this network will be mirrored. It is mandatory
        that all mirrored VMs have a network interface controller (NIC) in
        the given network. All mirrored subnetworks should belong to the
        given network.

        You can provide this as the full URL to the network, partial URL,
        or name.
        For example, the following are valid values:
          * https://compute.googleapis.com/compute/v1/projects/myproject/
            global/networks/network-1
          * projects/myproject/global/networks/network-1
          * network-1
        r$   r4   r:   r,   s    r   r8   r8   R   s       r   c                 0    U R                  SU(       + SS9  g )Nz--collector-ilba+        Forwarding rule configured as collector. This must be a regional
      forwarding rule (in the same region) with load balancing scheme INTERNAL
      and isMirroringCollector set to true.

      You can provide this as the full URL to the forwarding rule, partial URL,
      or name.
      For example, the following are valid values:
        * https://compute.googleapis.com/compute/v1/projects/myproject/
          regions/us-central1/forwardingRules/fr-1
        * projects/myproject/regions/us-central1/forwardingRules/fr-1
        * fr-1
      rC   rD   rA   s     r   r9   r9   g   s#      
  r   c                 ~   U(       a  U R                  SS9nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SSS9  UR                  S	[        R                  " 5       SS
S9  UR                  SSSSS9  gU R                  S[        R                  " 5       SSS9  g)z(Adds args to specify mirrored instances.zD      Update the mirrored instances of this packet mirroring.
      r3   z--add-mirrored-instancesINSTANCEz1List of instances to add to the packet mirroring.typemetavarr4   z--remove-mirrored-instancesz6List of instances to remove from the packet mirroring.z--set-mirrored-instancesz9List of instances to be mirrored on the packet mirroring.z--clear-mirrored-instancesr5   NzEIf specified, clear the existing instances from the packet mirroring.r6   r7   r4   z--mirrored-instancesa|          List of instances to be mirrored.
        You can provide this as the full or valid partial URL to the instance.
        For example, the following are valid values:
          * https://compute.googleapis.com/compute/v1/projects/myproject/
            zones/us-central1-a/instances/instance-
          * projects/myproject/zones/us-central1-a/instances/instance-1
        add_mutually_exclusive_groupr:   r   ArgList)r-   r0   	instancess      r   r;   r;   z   s    33 :
3 I "  "@	   %  "E	   "  "H	   $+	  -   "	  r   c                 ~   U(       a  U R                  SS9nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SSS9  UR                  S	[        R                  " 5       SS
S9  UR                  SSSSS9  gU R                  S[        R                  " 5       SSS9  g)z&Adds args to specify mirrored subnets.zB      Update the mirrored subnets of this packet mirroring.
      r3   z--add-mirrored-subnetsSUBNETz/List of subnets to add to the packet mirroring.rH   z--remove-mirrored-subnetsz4List of subnets to remove from the packet mirroring.z--set-mirrored-subnetsz7List of subnets to be mirrored on the packet mirroring.z--clear-mirrored-subnetsr5   NzCIf specified, clear the existing subnets from the packet mirroring.rK   z--mirrored-subnetsa          List of subnets to be mirrored.
        You can provide this as the full URL to the subnet, partial URL, or
        name.
        For example, the following are valid values:
          * https://compute.googleapis.com/compute/v1/projects/myproject/
            regions/us-central1/subnetworks/subnet-1
          * projects/myproject/regions/us-central1/subnetworks/subnet-1
          * subnet-1
        rL   )r-   r0   subnetss      r   r=   r=      s    11 8
1 G    ">	   #  "C	      "F	   "+	  -   "		  r   c                 ~   U(       a  U R                  SS9nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SSS9  UR                  S	[        R                  " 5       SS
S9  UR                  SSSSS9  gU R                  S[        R                  " 5       SSS9  g)z#Adds args to specify mirrored tags.aG        Update the mirrored tags of this packet mirroring.

      To read more about configuring network tags, read this guide:
      https://cloud.google.com/vpc/docs/add-remove-network-tags

      The virtual machines with the provided tags must live
      in zones contained in the same region as this packet mirroring.
      r3   z--add-mirrored-tagsTAGz,List of tags to add to the packet mirroring.rH   z--remove-mirrored-tagsz1List of tags to remove from the packet mirroring.z--set-mirrored-tagsz4List of tags to be mirrored on the packet mirroring.z--clear-mirrored-tagsr5   Nz@If specified, clear the existing tags from the packet mirroring.rK   z--mirrored-tagsaV          List of virtual machine instance tags to be mirrored.

        To read more about configuring network tags, read this guide:
        https://cloud.google.com/vpc/docs/add-remove-network-tags

        The virtual machines with the provided tags must live
        in zones contained in the same region as this packet mirroring.
        rL   )r-   r0   tagss      r   r<   r<      s    .. 5
. D 	  ";	   	   "@	   	  "C	   	dO  Q   "	  r   c                 ~   U(       a  U R                  SS9nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SSS9  UR                  S	[        R                  " 5       SS
S9  UR                  SSSSS9  gU R                  S[        R                  " 5       SSS9  g)z(Adds args to specify filter CIDR ranges.z7Update the filter CIDR ranges of this packet mirroring.r3   z--add-filter-cidr-ranges
CIDR_RANGEz:List of filter CIDR ranges to add to the packet mirroring.rH   z--remove-filter-cidr-rangesz?List of filter CIDR ranges to remove from the packet mirroring.z--set-filter-cidr-rangeszS        List of filter CIDR ranges to be mirrored on the packet mirroring.
        z--clear-filter-cidr-rangesr5   Nzg        If specified, clear the existing filter CIDR ranges from the packet
        mirroring.
        rK   z--filter-cidr-rangesa          One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source
        (ingress) or destination (egress) IP in the IP header. If no ranges are
        specified, all IPv4 traffic that matches the specified IPProtocols is
        mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4
        traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use
        0.0.0.0/0,::/0
        rL   )r-   r0   cidr_rangess      r   r>   r>     s    55F 6 HK"  "I	   %  "N	   "  "	   $	     "	  r   c                    U(       a  U R                  SS9nUR                  S[        R                  " [        S9SSS9  UR                  S[        R                  " [        S9SS	S9  UR                  S
[        R                  " [        S9SSS9  UR                  SSSSS9  gU R                  S[        R                  " [        S9SSS9  g)z)Adds args to specify filter IP protocols.z5Update the filter protocols of this packet mirroring.r3   z--add-filter-protocols)element_typePROTOCOLz        List of filter IP protocols to add to the packet mirroring.
        PROTOCOL can be one of tcp, udp, icmp, esp, ah, ipip, sctp, or an IANA
        protocol number.
        rH   z--remove-filter-protocolsz        List of filter IP protocols to remove from the packet mirroring.
        PROTOCOL can be one of tcp, udp, icmp, esp, ah, ipip, sctp, or an IANA
        protocol number.
        z--set-filter-protocolsz        List of filter IP protocols to be mirrored on the packet mirroring.
        PROTOCOL can be one of tcp, udp, icmp, esp, ah, ipip, sctp, or an IANA
        protocol number.
        z--clear-filter-protocolsr5   Nzh        If specified, clear the existing filter IP protocols from the packet
        mirroring.
        rK   z--filter-protocolsa          List of IP protocols that apply as filters for packet mirroring traffic.
        If unspecified, the packet mirroring applies to all traffic.
        PROTOCOL can be one of tcp, udp, icmp, esp, ah, ipip, sctp, or an IANA
        protocol number.
        )rM   r:   r   rN   str)r-   r0   	protocolss      r   r?   r?   8  s    33D 4 FI   c2	   #  c2	      c2	   "	     c2	  
r   c                 ,    U R                  S/ SQSSS9  g)z&Adds args to specify filter direction.z--filter-direction)bothegressingress	DIRECTIONz        - For `ingress`, only ingress traffic is mirrored.
        - For `egress`, only egress traffic is mirrored.
        - For `both` (default), both directions are mirrored.
        )choicesrJ   r4   NrD   r,   s    r   r@   r@   n  s#    +	  	r   N)TF)F)__doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   compute_completersr   r&   ListCommandCompleterr
   r(   r.   r1   r+   r8   r9   r;   r=   r<   r>   r?   r@   r   r   r   <module>rj      sp    7 &  ' / O E1FF 6
'
!6*&*Z,^.b.b3lr   