
    E                     ,   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K
Jr  SS	KJr  \	R                  \	R                   " \	R"                  R$                  \	R"                  R&                  5       " S
 S\	R(                  5      5       5       rg)z*Create command for Backup for GKE restore.    )absolute_import)division)unicode_literals)util)base)hooks)resource_args)labels_utilc                   .    \ rS rSrSr\S 5       rS rSrg)Create   av  Creates a restore.

Creates a Backup for GKE restore.

## EXAMPLES

To create a restore ``my-restore'' in location ``us-central1'' under restore
plan ``my-restore-plan'', run:

  $ {command} my-restore --project=my-project --location=us-central1
  --restore-plan=my-restore-plan
  --backup=projects/my-project/locations/us-east1/backupPlans/my-backup-plan/backups/my-backup
c                 h   [         R                  " U 5        U R                  SS9nUR                  SSSSSS9  UR                  SSSSS	S9  U R                  S
[        SSS9  U R                  S[        SS SS9  U R                  SSS SS9  U R                  SSS SS9  [
        R                  " U 5        g )NT)mutexz--asyncF
store_truezh
        Return immediately, without waiting for the operation in progress to
        complete.
        )requiredactiondefaulthelpz--wait-for-completionz)Wait for the created restore to complete.z--backupz
        Name of the backup from which to restore under the backup plan specified
        in restore plan.
        Format: projects/<project>/locations/<location>/backupPlans/<backupPlan>/backups/<backup>.
        )typer   r   z--descriptionz*Optional text description for the restore.)r   r   r   r   z+--volume-data-restore-policy-overrides-filez
        If provided, defines an array of volume data restore policy overrides
        from the given config file in yaml.
        )r   r   r   z--filter-filea  
        JSON/YAML file containing the configuration of the fine-grained
        restore filter which can be used to further refine the resource
        selection of the Restore beyond the coarse-grained scope defined
        in the RestorePlan.

        For more information about examples and how to use this filter,
        please refer to the Backup for GKE documentation:
        https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/how-to/fine-grained-restore.
        )r	   AddRestoreArg	add_groupadd_argumentstrr
   AddCreateLabelsFlags)parsergroups     7lib/surface/container/backup_restore/restores/create.pyArgsCreate.Args-   s   '4(E	  	 
8   	  	 9   5	   		   $$V,    c           	      N   [         R                  " U5      n[        R                  " UR                  5      nUR
                  R                  R                  5       n[        R                  " UR                  5      nUR                  S5      (       a-  [        R                  " UUR                  UR                  UUUS9$ [        R                  " UUR                  UR                  UUUS9  UR                  S5      (       d  / $ [        R                   " UR#                  5       5      $ )Nasync)backupdescriptionlabels$volume_data_restore_policy_overridesrestore_filter)restore_refr#   r$   r%   r&   r'   wait_for_completion)r
   GetUpdateLabelsDictFromArgsr   (ReadVolumeDataRestorePolicyOverridesFile)volume_data_restore_policy_overrides_fileCONCEPTSrestoreParseReadRestoreFilterFilefilter_fileIsSpecifiedapi_utilCreateRestorer#   r$   CreateRestoreAndWaitForLROWaitForRestoreToFinishRelativeName)selfargsr%   vdrpor(   r'   s         r   Run
Create.Runq   s    44T:F::66E --''--/K001A1ABN  ##
&&/4'  ''{{$$-2% 122i**;+C+C+EFFr     N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r;   __static_attributes__r=   r    r   r   r      s$     A- A-FGr    r   N)rB   
__future__r   r   r   /googlecloudsdk.api_lib.container.backup_restorer   r3   googlecloudsdk.callioper   3googlecloudsdk.command_lib.container.backup_restorer   r	   $googlecloudsdk.command_lib.util.argsr
   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHABETACreateCommandr   r=   r    r   <module>rP      s}    1 &  ' L ( E M < D%%++T->->-C-CDmGT mG E mGr    