
    AL              	       h   S r SSKJr  SSKJr  SSKJr  SSK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  SSKJr  \
R(                  " SSS\
R*                  SS9r\
R(                  " S\	R.                  " S\R0                  SS9S\
R*                  SS9r\R4                  " S\R6                  " SS5      R8                  R:                  SSSS .SS!S"9r\
R(                  " S#S$S%SS&S'9r\ \ \ S(.r!\ \ S).r"S*r#S+ r$\ \ \ \$\	RJ                  " 5       \	RJ                  " 5       \	RJ                  " 5       S,.r&/ S-Qr'S.r(\ \ \ S/.r)S0S1/r*SJS2 jr+SJS3 jr,SKS4 jr-    SLS5 jr.SMS6 jr/SJS7 jr0S8 r1SJS9 jr2S: r3SJS; jr4SJS< jr5SKS= jr6 SNS> jr7 SNS? jr8S@ r9SA r:SB r;SC r<SD r=SE r>SF r?SG r@SH rASI rBg)Oz Flags for data-catalog commands.    )absolute_import)division)unicode_literalsN)apis)arg_parsers)base)
exceptions)concepts)	arg_utils)	yaml_data)concept_parsers)presentation_specsz--filter
EXPRESSIONFaS      Apply a Boolean filter _EXPRESSION_ to each resource item to be listed.
    If the expression evaluates `True`, then that item is listed. For more
    details and examples of filter expressions, run $ gcloud topic filters. This
    flag interacts with other flags that are applied in this order: *--flatten*,
    *--filter*, *--limit*.)metavarrequire_coverage_in_testscategoryhelpz--limit   T)	unlimitedz    Maximum number of resources to list. The default is *unlimited*.
    This flag interacts with other flags that are applied in this order:
    *--flatten*, *--filter*, *--limit*.
    )typer   r   r   z--snapshot-auto-deletebaremetalsolutionv2)znewest-firstz!Delete the newest snapshot first.)zoldest-firstz!Delete the oldest snapshot first.)disabledzoDon't delete any snapshots. This disables new snapshot creation as long as the snapshot reserved space is full.)NEWEST_FIRSTOLDEST_FIRSTDISABLEDz:Behavior of the disk when snapshot reserved space is full.)arg_namemessage_enumcustom_mappingsrequiredhelp_strz--async
store_trueasync_zV    Return immediately, without waiting for the operation in progress to
    complete.)actiondestdefaultr   )start-addressend-addressnote)r'   r(   a  
Adds an allowed client to the NFS share. This flag can be repeated to specify multiple allowed clients.

*network*::: The name of the network to allow.

*network-project-id*::: The project ID of the allowed client network.
If not present, the project ID of the NFS share will be used.

*cidr*::: The subnet of IP addresses permitted to access the NFS
share.

*mount-permissions*::: The mount permissions for the allowed client.
``MOUNT_PERMISSIONS'' must be one of: `READ_ONLY`, `READ_WRITE`.

*allow-dev*::: If ``yes'', allows creation of devices.

*allow-suid*::: If ``yes'', allows SUID.

*enable-root-squash*::: If ``yes'', enables root squashing which
is a special mapping of the remote superuser (root) identity when
using identity authentication .
c                     U R                  5       nU[        ;  a&  [        R                  " SSR	                  U 5      5      eU$ )zCValidates NFS mount permissions field, throws exception if invalid.--allowed-clientz&Invalid value {} for mount-permissions)upperNFS_MOUNT_PERMISSIONS_CHOICESr	   InvalidArgumentExceptionformat)mount_permissions_inputmount_permissionss     +lib/googlecloudsdk/command_lib/bms/flags.py_ValidateNFSMountPermissionsr3   v   sI    -335;;

-
-077#	%& & 
    )networknetwork-project-idcidrmount-permissions	allow-dev
allow-suidenable-root-squash)r5   r7   r8   r9   r:   r;   )	READ_ONLY
READ_WRITE)r5   r6   r7   r5   r7   c                 ,   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ ).Sets up an argument for the instance resource.instancez
--instancezbms.instanceTz	instance.nameconcept_specr    
group_helpr   ResourceYAMLDataFromPathr
   ResourceSpecFromYamlGetDatar   ResourcePresentationSpecr   ConceptParserAddToParser)parser
positionalrB   instance_dataresource_specpresentation_specs         r2   AddInstanceArgToParserrS          DD,,55-''001F1F1HI-(AA 	
 
	&	&(9':	;	G	G	OOr4   c                 ,   [         R                  R                  S5      n[        R                  R                  UR                  5       5      nU(       a  SnOSn[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )zParses region flag.z
bms.regionregionz--regionFzregion.rA   rE   )rN   rO   region_datarQ   rB   rR   s         r2   AddRegionArgToParserrX      s    **33LA+''001D1D1FG-DD(AA 	
 
	&	&(9':	;	G	G	OOr4   c                 >   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSU=(       d    SS9n[        R                  " U/5      R                  U 5      $ )r?   volumez--volumez
bms.volumeTzvolume.rA   rE   )rN   rO   group_help_textrB   volume_datarQ   rR   s          r2   AddVolumeArgToParserr]      s    DD**33+''001D1D1FG-(AA  -I	/
 
	&	&(9':	;	G	G	OOr4   c           	      B   U(       d  U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUUUSS0SS9n[        R                  " U/5      R                  U 5      $ )z>Sets up an argument for the snapshot schedule policy resource.snapshot_schedule_policyz--snapshot-schedule-policyzbms.snapshot_schedule_policyrV    zsnapshot_schedule_policy.)rB   grouprC   r    flag_name_overridesrD   rE   )rN   rO   r    rB   ra   policy_datarQ   rR   s           r2   $AddSnapshotSchedulePolicyArgToParserrd      s     
'd)d**33$&+''001D1D1FG-(AA #R.,. 
	&	&(9':	;	G	G	OOr4   c           
          [         [        [         S.nU R                  SU[        R                  " U[        U5      UR                  5       S9SSSS9  g)	z,Sets up an argument for a snapshot schedule.)crontab_specretention_countprefixz
--schedule)spec
max_lengthrequired_keysappendz#CRONTAB_SPEC,RETENTION_COUNT,PREFIXaE  
              Adds a schedule for taking snapshots of volumes under this policy.
              This flag may be repeated to specify up to 5 schedules.

              *crontab_spec*::: Specification of the times at which snapshots
              will be taken. This should be in Crontab format:
              http://en.wikipedia.org/wiki/Cron#Overview

              *retention_count*::: The maximum number of snapshots to retain in
              this schedule.

              *prefix*::: Value to append to the name of snapshots created by
              this schedule.

           )r    r   r$   r   r   N)strintadd_argumentr   ArgDictlenkeys)rN   r    ri   s      r2   "AddSnapshotScheduleArgListToParserrs      s\     
$
 	D*-d)-1YY[: 3  r4   c                 ,   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )z-Sets up an argument for the network resource.r5   z	--networkzbms.networkTznetwork.rA   rE   )rN   rO   rB   rc   rQ   rR   s         r2   AddNetworkArgToParserru   	  s    DD**33+''001D1D1FG-(AA 	 
	&	&(9':	;	G	G	OOr4   c                    Sn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )1Sets up an argument for a volume snapshot policy.lunzbms.lunTzlun.rA   rE   )rN   rB   snapshot_datarQ   rR   s        r2   AddLunArgToParserrz     s{    	$,,55i@-''001F1F1HI-(AA 	
 
	&	&(9':	;	G	G	OOr4   c                 ,   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )rw   snapshotz
--snapshotzbms.snapshotTz	snapshot.rA   rE   )rN   rO   rB   ry   rQ   rR   s         r2   AddVolumeSnapshotArgToParserr}   (  s    DD,,55nE-''001F1F1HI-(AA 	
 
	&	&(9':	;	G	G	OOr4   c                 B    [         R                  R                  U 5        g)zDSets up an argument for a volume snapshot auto-delete-behavior enum.N)+VOLUME_SNAPSHOT_AUTO_DELETE_BEHAVIOR_MAPPER
choice_argrM   rN   s    r2   .AddVolumeSnapshotAutoDeleteBehaviorArgToParserr   8  s    -88DDVLr4   c                 ,   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )z.Sets up an argument for an nfs-share resource.	nfs_sharez--nfs_sharezbms.nfs_shareTz
nfs_share.rA   rE   )rN   rO   rB   nfs_datarQ   rR   s         r2   AddNfsShareArgToParserr   =  s    DD''00(''001A1A1CD-(AA 	
 
	&	&(9':	;	G	G	OOr4   c                 ,   U(       a  SnOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )z-Sets up an argument for an os-image resource.os_image
--os-imagezbms.os_imageTz	os_image.rA   rE   )rN   rO   rB   os_image_datarQ   rR   s         r2   AddOsImageArgToParserr   N  rT   r4   c                 0   U(       a  SOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " UUSSS0SS9n[        R                  " U/5      R                  U 5      $ )	z<Sets up an argument for the serial-console-ssh-key resource.serial_console_ssh_keyz--serial-console-ssh-keyzbms.serial_console_ssh_keyTrV   r`   zserial_console_ssh_key.)rB   rC   r    rb   rD   rE   )rN   rO   rB   ssh_key_datarQ   rR   s         r2   !AddSerialConsoleSshKeyArgToParserr   _  s    %/	!5O$++44", ''001E1E1GH-(AA #R.* 
	&	&(9':	;	G	G	OOr4   c                 R    U R                  US9n[        UUUUUS9  [        U5        g )Nr    )rO   rB   pluralr    )add_mutually_exclusive_groupAddSshKeyArgToParserAddClearSshKeyToParser)rN   rO   rB   r    r   group_parsers         r2    AddProvisioningSshKeyArgToParserr   p  s8     44h4G, &r4   c           	      J   U(       a  SOSn[         R                  R                  S5      n[        R                  R                  UR                  5       5      n[        R                  " U(       d  UOU S3UUSS0SUS9n[        R                  " U/5      R                  U 5      $ )	z-Sets up an argument for the ssh-key resource.ssh_keyz	--ssh-keyzbms.ssh_keysrV   r`   zssh_key.)rB   rC   r    rb   rD   r   rE   )rN   rO   rB   r    r   r   rQ   rR   s           r2   r   r   ~  s     !k$++44]C,''001E1E1GH-(AA4dV1: #R. 
	&	&(9':	;	G	G	OOr4   c                 (    U R                  SSSSS9  g )Nz--clear-ssh-keysr"   z-Provisions the instance without any SSH keys.F)r$   r   r    )ro   r   s    r2   r   r     s!    >	  r4   c                 J    U R                  S[        SR                  US9SS9  g )Nz
--new-namez8New {name} name for renaming an already existing {name}.)rB   T)r   r   r    )ro   rm   r/   )rN   obj_names     r2   AddNewNameArgToParserr     s5    IPP Q   r4   c                 2    U R                  S[        SUUS9  g )Nr   z
              OS image to install on the server.

              To list all OS image codes supported by BMS, run:

                  $ gcloud bms os-images list
        )r   r   hiddenr    ro   rm   )rN   r   r    s      r2   AddInstanceOsImageToParserr     s(       r4   c                 D    U R                  S[        R                  SUS9  g )Nz--enable-hyperthreadingz%Enable hyperthreading for the server.r$   r   r   )ro   r   StoreTrueFalseActionrN   r   s     r2   'AddInstanceEnableHyperthreadingToParserr     s'    --6	  r4   c                     U R                  SS9nUR                  S[        R                  " [        S9SSUS9  UR                  S[        R                  " [
        S9SS	US9  UR                  S
SSUS9  g)z:Adds the flags for network IP range reservation to parser.Fr   z--add-ip-range-reservation)ri   PROPERTY=VALUEau  
              Add a reservation of a range of IP addresses in the network.

              *start_address*::: The first address of this reservation block.
              Must be specified as a single IPv4 address, e.g. `10.1.2.2`.

              *end_address*::: The last address of this reservation block,
              inclusive. I.e., for cases when reservations are only single
              addresses, end_address and start_address will be the same.
              Must be specified as a single IPv4 address, e.g. `10.1.2.2`.

              *note*::: A note about this reservation, intended for human consumption.
            )r   r   r   r   z--remove-ip-range-reservationa  
              Remove a reservation of a range of IP addresses in the network.

              *start_address*::: The first address of the reservation block to remove.

              *end_address*::: The last address of the reservation block to remove.
            z--clear-ip-range-reservationsr"   1Removes all IP range reservations in the network.r   N)r   ro   r   rp   IP_RESERVATION_SPECIP_RESERVATION_KEY_SPECrN   r   	group_args      r2   AddNetworkIpReservationToParserr     s    1151A)"$78 #  $ %$;<    %B	  r4   c                 0    U R                  SS[        SS9  g)zAdds size GiB argument for NFS.z
--size-gibz*The requested size of the NFS share in GiBT)r   r   r    N)ro   rn   r   s    r2   AddNfsSizeGibArgr     s!    7	  r4   c                 L    U R                  SSSS.S[        R                  SS9  g)	z#Adds storage type argument for NFS.z--storage-typez5The storage type of the underlying volume will be SSDz5The storage type of the underlying volume will be HDD)SSDHDDTz\Specifies the storage type of the underlying volume which will be created for the NFS share.)choicesr    r   r   N)ro   r   ChoiceToEnumNamer   s    r2   AddNfsStorageTypeArgr     s9     FE	 %%*  ,r4   c           	      j    U R                  S[        R                  " [        [        S9SSS[
        S9  g )Nr+   ri   rk   Trl   r   )r   r    r$   r   r   )ro   r   rp   NFS_ALLOWED_CLIENT_SPEC REQUIRED_NFS_ALLOWED_CLIENT_KEYSNFS_ALLOWED_CLIENTS_HELP_TEXTr   s    r2   AddNfsAllowedClientArgr     s:    $;-M! (  	r4   c                    U R                  SUS9nUR                  S[        R                  " [        [
        S9SS[        S9  UR                  S[        R                  " [        [        S9SSS	S9  UR                  S
SSS9  g)z0Adds NFS update allowed clients arguments group.F)r    r   z--add-allowed-clientr   rl   r   )r   r$   r   r   z--remove-allowed-clienta  
              Removes an allowed client for the NFS share given its network name and cidr. This flag can be repeated to remove multiple allowed clients.

              *network*::: The name of the network of the allowed client to remove.

              *network-project-id*::: The project ID of the allowed client network.
              If not present, the project ID of the NFS share will be used.

              *cidr*::: The subnet of permitted IP addresses of the allowed client to remove.
            z--clear-allowed-clientsr"   r   )r$   r   N)	r   ro   r   rp   r   r   r   REMOVE_NFS_ALLOWED_CLIENT_SPEC'REQUIRED_REMOVE_NFS_ALLOWED_CLIENT_KEYSr   s      r2   AddNfsUpdateAllowedClientArgsr     s    1151P)&8 (  	 -? 	  $ B  Dr4   c                 0    U R                  S[        SUS9  g )Nz--kms-crypto-key-versionz
      Resource ID of a KMS CryptoKeyVersion used to encrypt the initial password.

      https://cloud.google.com/kms/docs/resource-hierarchy#key_versions
      )r   r   r   r   r   s     r2   AddKMSCryptoKeyVersionToParserr   -  s%     

   	r4   )F)FN)FTNN)T)FNTF)C__doc__
__future__r   r   r   sysgooglecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   r	    googlecloudsdk.calliope.conceptsr
   $googlecloudsdk.command_lib.util.apisr   r   (googlecloudsdk.command_lib.util.conceptsr   r   ArgumentLIST_COMMAND_FLAGSFILTER_FLAG_NO_SORTBY_DOC
BoundedIntmaxsizeLIMIT_FLAG_NO_SORTBY_DOCChoiceEnumMapperGetMessagesModuleVolume)SnapshotAutoDeleteBehaviorValueValuesEnumr   ASYNC_FLAG_DEFAULT_TRUErm   r   r   r   r3   
ArgBooleanr   r   r-   r   r   rS   rX   r]   rd   rs   ru   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r4   r2   <module>r      sB   ' &  ' 
 , / ( . 5 : : D G MM#$$

   ==			3;;$	?#$$
		  /8.H.H%''f>>MMG I/K +  --	
     
! 0 5'')((*%002 $   !< "  
+ 'P"P P$ 5:26.2/3	P0BP$
PP M
P"P"P$ @E' @EP$ %P, 
"DJ
r4   