
    }                         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rS	rS
 rSS jrS rS rS rS rS rS rS rg)z:Flags and helpers for the compute machine-images commands.    )absolute_import)division)unicode_literals)arg_parsers)
completers)flagsz)    table(
      name,
      status
    )z#DISK_DEVICE_NAME[,DISK_DEVICE_NAME]c            
      n    [         R                  " SS[        R                  SSS[         R                  S9$ )Ninstancez--source-instanceTzcompute.instancesz3The source instance to create a machine image from.)resource_namename	completerrequiredzonal_collection
short_helpzone_explanation)compute_flagsResourceArgumentcompute_completersInstancesCompleterZONE_PROPERTY_EXPLANATION     >lib/googlecloudsdk/command_lib/compute/machine_images/flags.pyMakeSourceInstanceArgr   "   s6    		'	'"55*F$>>
 r   c                 N    [         R                  " SS[        R                  U SS9$ )NIMAGEmachineImagezcompute.machineImages)r   r   r   pluralglobal_collection)r   r   r   MachineImagesCompleter)r   s    r   MakeMachineImageArgr!   .   s*    		'	'""99/
 r   c                 D    U R                  SSS9  U R                  SSS9  g)z2Set arguments for choosing the network/subnetwork.z	--networka        Specifies the network for the VMs that are created from the imported
      machine image. If `--subnet` is also specified, then the subnet must
      be a subnetwork of network specified by `--network`. If neither is
      specified, the `default` network is used.
      helpz--subnetz      Specifies the subnet for the VMs created from the imported machine
      image. If `--network` is also specified, the subnet must be
      a subnetwork of the network specified by `--network`.
      Nadd_argumentparsers    r   AddNetworkArgsr)   8   s:    
   	
  r   c                 (    U R                  SSSSS9  g )Nz--restart-on-failure
store_trueTz      The VMs created from the imported machine image are restarted if
      they are terminated by Compute Engine. This does not affect terminations
      performed by the user.
      )actiondefaultr$   r%   r'   s    r   AddNoRestartOnFailureArgsr.   N   s#    
	  	r   c                 L    U R                  S[        R                  " SS9SSS9  g )Nz--tags   
min_lengthTAGa        Specifies a list of tags to apply to the VMs created from the
      imported machine image. These tags allow network firewall rules and routes
      to be applied to specified VMs. See
      gcloud_compute_firewall-rules_create(1) for more details.

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

      To list VMs with their respective status and tags, run:

        $ gcloud compute instances list --format='table(name,status,tags.list())'

      To list VMs tagged with a specific tag, `tag1`, run:

        $ gcloud compute instances list --filter='tags:tag1'
      )typemetavarr$   )r&   r   ArgListr'   s    r   AddTagsArgsr7   [   s.    !,
	  r   c                 (    U R                  SS SS9  g)z%Adds network tier flag to the parser.z--network-tierc                 "    U R                  5       $ )N)upper)xs    r   <lambda>$AddNetworkTierArgs.<locals>.<lambda>y   s
    QWWYr   z        Specifies the network tier that will be used to configure the machine
        image. ``NETWORK_TIER'' must be one of: `PREMIUM`, `STANDARD`. The
        default value is `PREMIUM`.
        )r4   r$   Nr%   r'   s    r   AddNetworkTierArgsr>   t   s"     	  r   c                 &    U R                  SSSS9  g )Nz--can-ip-forwardr+   z        If provided, allows the VMs created from the imported machine
        image to send and receive packets with non-matching destination or
        source IP addresses.
        )r,   r$   r%   r'   s    r   AddCanIpForwardArgsr@      s       r   c                 $    U R                  SSS9  g)z2Set arguments for choosing the network IP address.z--private-network-ipz        Specifies the RFC1918 IP to assign to the VMs created from the
        imported machine image. The IP should be in the subnet or legacy network
        IP range.
      r#   Nr%   r'   s    r   AddPrivateNetworkIpArgsrB      s    
  r   c           	          U R                  SS9nUR                  S[        S[        R                  " SS9SS9  UR                  S[        S	[        R                  " SS9SS9  g
)z=Adds exclusion and inclusion filters for machine image disks.T)hiddenz--exclude-disksa          Specifies a filter for disks to be excluded from the machine image.
        The filter is a comma-separated list of disk device names. Excluding the
        boot disk device name is not permitted.
        Cannot be used in conjunction with --include-disks.
      r0   r1   )r5   r$   r4   rD   z--include-disksa          Specifies a filter for disks to be included in the machine image.
        The filter is a comma-separated list of disk device names. Always
        include the boot disk device name.
        Cannot be used in conjunction with --exclude-disks.
      N)add_mutually_exclusive_groupr&   DISK_FILTER_FORMATr   r6   )r(   groups     r   AddDiskFilterArgsrH      sy    

-
-T
-
:% 
 !,    
 !,  r   N)F)__doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   r   r   DEFAULT_LIST_FORMATrF   r   r!   r)   r.   r7   r>   r@   rB   rH   r   r   r   <module>rN      sZ    A &  ' / O E	  ; 	,
2		r   