
    (                        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 j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S j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S jrSS jrSS jrSS jrS rSS jrg)z*Flags for backup-dr restore disk commands.    )absolute_import)division)unicode_literals)arg_parsers)util)	arg_utilsc                 0    U R                  S[        USS9  g )Nz--namezName of the restored Disk.typerequiredhelpadd_argumentstrparserr   s     =lib/googlecloudsdk/command_lib/backupdr/restore/disk_flags.py
AddNameArgr      s!    '	      c                 0    U R                  S[        USS9  g )Nz--target-zonez]Zone where the target disk is restored. This flag is mutually exclusive with --target-region.r
   r   r   s     r   AddTargetZoneArgr   #   s#    -  r   c                 0    U R                  S[        USS9  g )Nz--target-regionz]Region where the target disk is restored. This flag is mutually exclusive with --target-zone.r
   r   r   s     r   AddTargetRegionArgr   /   s#    +  r   c                 0    U R                  S[        USS9  g )Nz--target-projectz(Project where the restore should happen.r
   r   r   s     r   AddTargetProjectArgr   ;   s!    5	  r   c           	      Z    U R                  S[        R                  " SS[        S9SUSS9  g )Nz--replica-zones   )
min_length
max_lengthelement_typeZONEa  A comma-separated list of exactly 2 URLs of the zones where the disk should be replicated to. Required when restoring to a regional disk. The zones must be in the same region as specified in the --target-region flag. See available zones with gcloud compute zones list.r   metavarr   r   )r   r   ArgListr   r   s     r   AddReplicaZonesArgr%   D   s5    !L(  r   c                 N    U R                  S[        R                  " SS9SUSS9  g )Nz
--licenses   r   LICENSEzA list of URIs to license resources. The provided licenses will be added onto the created disks to indicate the licensing and billing policies.r"   r   r   r$   r   s     r   AddLicensesArgr+   T   s1    !,  
r   c                     Sn[         R                  " SU5      nU R                  S[        R                  " U5      SUSR                  SR                  U5      5      S9  g)	zAdds a --guest-os-features flag to the given parser.

Args:
  parser: A given parser.
  required: Whether the argument is required or not.
)VIRTIO_SCSI_MULTIQUEUEWINDOWSMULTI_IP_SUBNETUEFI_COMPATIBLESEV_CAPABLESEV_LIVE_MIGRATABLESEV_LIVE_MIGRATABLE_V2SEV_SNP_CAPABLEGVNICIDPFTDX_CAPABLESUSPEND_RESUME_COMPATIBLEzguest-os-featuresz--guest-os-featuresGUEST_OS_FEATURESa  Enables one or more features for VM instances that use the image for their boot disks. See the descriptions of supported features at: https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images#guest-os-features. GUEST_OS_FEATURE must be one of: {}.z, r"   N)r   GetOneOfValidatorr   r   r$   formatjoin)r   r   guest_os_features_optionsguest_os_features_validators       r   AddGuestOsFeaturesArgsr?   b   sn     !% 6 64! 	:;!2 39&ii123  r   c                 0    U R                  S[        USS9  g)z!Description of the restored disk.z--descriptionz5Specifies a textual description of the restored disk.r
   Nr   r   s     r   AddDescriptionArgrA      s!    B	  r   c                 4    SnU R                  SU[        US9  g)z~Adds a --type flag to the given parser.

Args:
  parser: A given parser.
  required: Whether the argument is required or not.
zURL of the disk type describing which disk type to use to restore the disk. For example: projects/project/zones/zone/diskTypes/pd-ssd. To get a list of available disk types, run gcloud compute disk-types list. The default disk type is pd-standard.
z--type)r   r   r   Nr   )r   r   	help_texts      r   
AddTypeArgrD      s*    ) 		  r   c                 N    U R                  SSSSS.[        R                  USS9  g )Nz--access-modezUThe default AccessMode, means the disk can be attached to single instance in RW mode.zOThe AccessMode means the disk can be attached to multiple instances in RW mode.zOThe AccessMode means the disk can be attached to multiple instances in RO mode.)READ_WRITE_SINGLEREAD_ONLY_MANYREAD_WRITE_MANYaw  Specifies how VMs attached to the disk can access the data on the disk. To grant read-only access to multiple VMs attached to the disk, set access-mode to READ_ONLY_MANY. To grant read-write access to only one VM attached to the disk, use READ_WRITE_SINGLE. READ_WRITE_SINGLE is used if omitted. ACCESS_MODE must be one of: READ_ONLY_MANY, READ_WRITE_MANY, READ_WRITE_SINGLE.choicesr   r   r   r   r   ChoiceToEnumNamer   s     r   AddAccessModeArgrM      s@    &'' %%A'  r   c           	      V    SnU R                  SU[        R                  " 5       0 SUS9  g)zLabels to be added to the disk.a        List of label KEY=VALUE pairs to add.

      Keys must start with a lowercase character and contain only hyphens (-),
      underscores (_), lowercase characters, and numbers. Values must contain
      only hyphens (-), underscores (_), lowercase characters, and numbers.
      z--labelsz	KEY=VALUE)r   r   defaultr#   r   N)r   r   ArgDictr   r   helptexts      r   AddLabelsArgrS      s9    
( 	   r   c                 N    U R                  S[        R                  " 5       USS9  g)z(Machine type used for the restored disk.z--provisioned-iopszeProvisioned IOPS of disk to create. Only for use with disks of type pd-extreme and hyperdisk-extreme.r
   Nr   r   
BoundedIntr   s     r   AddProvisionedIopsArgrW      s,    !!#.  r   c                 J    U R                  SSSS.[        R                  USS9$ )Nz--architecturez/The disk can only be used with x86_64 machines.z.The disk can only be used with ARM64 machines.)X86_64ARM64zSpecifies the architecture or processor type that this disk can support. For available processor types on Compute Engine, see https://cloud.google.com/compute/docs/cpu-platforms. ARCHITECTURE must be one of: ARM64, X86_64rI   rK   r   s     r   AddArchitectureArgr[      s;    			EC %%+ 
 
 r   c                 &    U R                  SUSSS9$ )Nz--confidential-compute
store_truez
      Creates the disk with confidential compute mode enabled. Encryption with a Cloud KMS key is required to enable this option.
      )r   actionr   r   r   s     r   AddConfidentialComputeArgr`      s(    			
	 
 
 r   c                 R    SnU R                  S[        R                  " 5       UUS9  g)zSize of the disk.a{        Size of the disk in GB.
      Disk size must be a multiple of 1 GB. If disk size is not specified,
      the default size of 500GB for pd-standard disks, 100GB for
      pd-balanced disks, 100GB for pd-ssd disks, and 1000GB for pd-extreme disks
      will be used.
      For details about disk size limits,
      refer to: https://cloud.google.com/compute/docs/disks
      z--sizer
   NrU   rQ   s      r   
AddSizeArgrb     s3    
( 	!!#	  r   c                 N    U R                  S[        R                  " 5       USS9  g )Nz--provisioned-throughputzProvisioned throughput of disk to create. The throughput unit is  MB per sec.  Only for use with disks of type hyperdisk-throughput.r
   rU   r   s     r   AddProvisionedThroughputArgrd     s-     !!#O  r   c                 R    SnU R                  S[        R                  " SS9SUUS9  g)z)ResourcePolicies to be added to the disk.z      A list of resource policy names to be added to the disk.
      The policies must exist in the same region as the disk.
      z--resource-policiesr'   r(   RESOURCE_POLICYr"   Nr*   rQ   s      r   AddResourcePoliciesArgrg   !  s8    
( 	!,  r   c                 4    SnU R                  S[        UUS9  g)z$Kms key to be added to the instance.z      The Cloud KMS (Key Management Service) cryptokey that will be used to protect the disk
      Provide the full resource name of the cryptokey in the format:
      projects/<project>/locations/<location>/keyRings/<key-ring>/cryptoKeys/<key>
      z	--kms-keyr
   Nr   rQ   s      r   AddKmsKeyArgri   0  s*    
(
 		  r   c                 ,    SnU R                  SSSUS9  g)z+Clear encryption key override for the disk.zB      The restored disk reverts to GMEK (CMEK is disabled).
      z--clear-encryption-keyr]   F)r^   r   r   Nr_   )r   rR   s     r   AddClearEncryptionKeyArgrk   ?  s*    
( 		  r   c                 4    SnU R                  S[        UUS9  g )NzO
      Specifies the URI of the storage pool in which the disk is created.
    z--storage-poolr
   r   rQ   s      r   AddStoragePoolArgrm   L  s*    ( 		  r   N)T)F)__doc__
__future__r   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.backupdrr   $googlecloudsdk.command_lib.util.apisr   r   r   r   r   r%   r+   r?   rA   rD   rM   rS   rW   r[   r`   rb   rd   rg   ri   rk   rm    r   r   <module>rt      s    1 &  ' / 4 :		 &R$<&
$&	
	r   