
    F              
       t   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ	 d dZ
d d	Zd
 Zd Zd Zd Zd Zd Z e	j$                  ddej&                  dddd      Z e	j$                  ddej&                  dddde	j*                  j,                        Z e	j$                  ddej0                  dddd      Zy)!z5Flags and helpers for the compute snapshots commands.    )absolute_import)division)unicode_literals)
completers)flagsFc                 R    t        j                  ddt        j                  | d      S )Nsnapshotsnapshot_namecompute.snapshots)resource_namename	completerpluralglobal_collectioncompute_flagsResourceArgumentcompute_completersRoutesCompleterr   s    9lib/googlecloudsdk/command_lib/compute/snapshots/flags.pyMakeSnapshotArgr      s*    		'	'"22+
     c                 T    t        j                  ddt        j                  | dd      S )Nr	   r
   zcompute.regionSnapshotsr   )r   r   r   r   regional_collectionr   r   r   s    r   #MakeSnapshotArgForRegionalSnapshotsr   #   s-    		'	'"223+
 r   c                     | j                  dd      }|j                  ddd       |j                  dd	t        j                  
       y)zYAdds scope flag to the parser.

  Args:
    parser: parser for command line arguments.
  TzScope for snapshot.)mutexhelpz--global
store_truez8If set, the snapshot will be created in the global scope)actionr   z--regionz:If set, the snapshot will be created in the regional scope)r   r   N)	add_groupadd_argumentr   RegionsCompleter)parsergroups     r   AddScopeArgr'   .   sa     

   %
 E   G"33  r   c                 *    | j                  dd       y )Nz--chain-namea  Create the new snapshot in the snapshot chain labeled with the specified name.
          The chain name must be 1-63 characters long and comply with RFC1035.
          Use this flag only if you are an advanced service owner who needs
          to create separate snapshot chains, for example, for chargeback tracking.
          When you describe your snapshot resource, this field is visible only
          if it has a non-empty value.r   r#   r%   s    r   AddChainArgr,   F   s    *  
r   c                 ,    | j                  ddd       y )Nz--source-disk-key-fileFILEz
      Path to the customer-supplied encryption key of the source disk.
      Required if the source disk is protected by a customer-supplied
      encryption key.
      metavarr   r*   r+   s    r   AddSourceDiskCsekKeyr1   T   s     
  r   c                 ,    | j                  ddd       y )Nz"--source-instant-snapshot-key-filer.   z
      Path to the customer-supplied encryption key of the source instant snapshot.
      Required if the source instant snapshot is protected by a customer-supplied
      encryption key.
      r/   r*   r+   s    r   AddSourceInstantSnapshotCsekKeyr3   `   s     *
  r   c                 F    t        ddg      }| j                  d|d       y )NSTANDARDARCHIVEz--snapshot-typezv
              Type of snapshot. If a snapshot type is not specified, a STANDARD snapshot will be created.
           )choicesr   )sortedr#   )r%   snapshot_type_choicess     r   AddSnapshotTyper:   l   s0     *i!89#  r   c                 *    | j                  dd       y )Nz--max-retention-daysz
    Days for snapshot to live before being automatically deleted. If unspecified, the snapshot will live until manually deleted.
    r)   r*   r+   s    r   AddMaxRetentionDaysr<   w   s      r   zsource diskz--source-diska  
    Source disk used to create the snapshot. To create a snapshot from a source
    disk in a different project, specify the full path to the source disk.
    For example:
    https://www.googleapis.com/compute/v1/projects/MY-PROJECT/zones/MY-ZONE/disks/MY-DISK
    zcompute.diskszcompute.regionDisks)r   r   r   
short_helpzonal_collectionr   requiredz#source disk for recovery checkpointz%--source-disk-for-recovery-checkpointa  
    Source disk whose recovery checkpoint used to create the snapshot. To create a snapshot from the recovery
    checkpoint of a source disk in a different project, specify the full path to the source disk.
    For example:
    projects/MY-PROJECT/regions/MY-REGION/disks/MY-DISK
    )r   r   r   r=   r   r   r?   scope_flags_usagezsource instant snapshotz--source-instant-snapshota  
    The name or URL of the source instant snapshot. If the name is provided, the instant snapshot's zone
or region must be specified with --source-instant-snapshot-zone or --source-instant-snapshot-region accordingly.
    To create a snapshot from an instant snapshot in a different project, specify the full path to the instant snapshot.
    If the URL is provided, format should be:
    https://www.googleapis.com/compute/v1/projects/MY-PROJECT/zones/MY-ZONE/instantSnapshots/MY-INSTANT-SNAPSHOT
    zcompute.instantSnapshotszcompute.regionInstantSnapshotsN)F)__doc__
__future__r   r   r   "googlecloudsdk.command_lib.computer   r   r   r   r   r   r'   r,   r1   r3   r:   r<   r   DisksCompleterSOURCE_DISK_ARGScopeFlagsUsageGENERATE_DEDICATED_SCOPE_FLAGS'SOURCE_DISK_FOR_RECOVERY_CHECKPOINT_ARGInstantSnapshotsCompleterSOURCE_INSTANT_SNAPSHOT_ARG r   r   <module>rL      s    < &  ' O E0		 1-00	 // %- +I-*H*H7	0 // .#33RR+ '  =m<<+	$ :: 08 r   