
    8                     L   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  SSKJr  SS
KJr  SSKJr  SSKJr  SrS*S jrS rS rS rS r S+S jrS rS*S jrS rS r S r!S r"S r#S r$S r%S r&S r'S r(S  r)S! r*S" r+S# r,S$ r-S% r.S& r/S' r0S( r1g)),zDFlags and helpers for the Cloud NetApp Files Storage Pools commands.    )absolute_import)division)unicode_literals)util)arg_parsers)base)concepts)flags)	arg_utils)labels_util)concept_parsersz    table(
        name.basename():label=STORAGE_POOL_NAME:sort=1,
        name.segment(3):label=LOCATION,
        serviceLevel,
        capacityGib,
        network,
        state,
        volumeCapacityGib,
        type
    )c                 l    SSSSS.n[         R                  " SU R                  R                  SUUS9nU$ )	zAdds a --service-level arg to the given parser.

Args:
  messages: The messages module.
  required: bool, whether choice arg is required or not

Returns:
  the choice arg.
)premiumz
                          Premium Service Level for Cloud NetApp Storage Pool.
                          The Premium Service Level has a throughput per GiB of
                          allocated volume size of 64 KiB/s.)extremez
                          Extreme Service Level for Cloud NetApp Storage Pool.
                          The Extreme Service Level has a throughput per GiB of
                          allocated volume size of 128 KiB/s.)standardz
                          Standard Service Level for Cloud NetApp Storage Pool.
                          The Standard Service Level has a throughput per GiB of
                          allocated volume size of 16 KiB/s.)flexz
                          Flex Service Level for Cloud NetApp Storage Pool.
                          The Flex Service Level has a throughput per GiB of
                          allocated volume size of 16 KiB/s.)PREMIUMEXTREMESTANDARDFLEXz--service-levelzThe service level for the Cloud NetApp Storage Pool.
       For more details, see:
       https://cloud.google.com/netapp/volumes/docs/configure-and-use/storage-pools/overview#service_levels
        )help_strcustom_mappingsrequired)r   ChoiceEnumMapperStoragePoolServiceLevelValueValuesEnum)messagesr   r   service_level_args       <lib/googlecloudsdk/command_lib/netapp/storage_pools/flags.pyGetStoragePoolServiceLevelArgr    0   sW    -/<  0066 &	 
    c                 T    [         R                  " U UR                  R                  S9$ )zReturns the Choice Enum for Directory Service Type.

Args:
  choice: The choice for directory service type as string
  messages: The messages module.

Returns:
  the directory service type enum.
choice	enum_type)r   ChoiceToEnumValidateDirectoryServiceRequest#DirectoryServiceTypeValueValuesEnumr$   r   s     r   "GetDirectoryServiceTypeEnumFromArgr*   e   s)     
		88\\
 r!   c                 Z    [         R                  " SU R                  R                  SS9nU$ )z(Adds the Qos Type arg to the arg parser.z
--qos-typez3Quality of service (QoS) type for the Storage Pool.)r   )r   r   r   QosTypeValueValuesEnum)r   qos_type_args     r   GetStoragePoolQosTypeArgr.   u   s/    ++11H,
 
r!   c                 T    [         R                  " U UR                  R                  S9$ )z,Returns the Choice Enum for StoragePoolType.r#   )r   r&   r   TypeValueValuesEnumr)   s     r   GetStoragePoolTypeEnumFromArgr1      s'    			$$88
 r!   c                     [         R                  " SUR                  R                  SSSS.S9nUR                  R                  U 5        g)z8Adds the --type arg to the arg parser for Storage Pools.z--typezThe type of the Storage Pool. `FILE` pools support file-based volumes only. `UNIFIED` pools support both file and block volumes.)filez"File-based volumes only (default).)unifiedzBoth file and block volumes.)FILEUNIFIED)r   r   N)r   r   r   r0   
choice_argAddToParser)parserr   type_args      r   AddStoragePoolTypeArgr;      sM    ''.. A@		( !!&)r!   c                 H    [        XS9R                  R                  U 5        g )Nr   )r    r7   r8   )r9   r   r   s      r   AddStoragePoolServiceLevelArgr>      s      J{{6"r!   c                 p    Sn[         R                  " SUS9  [        R                  R	                  U 5        g )NzPReturn immediately, without waiting for the operation
  in progress to complete.async)name	help_text)r	    ResourceParameterAttributeConfigr   
ASYNC_FLAGr8   )r9   rB   s     r   AddStoragePoolAsyncFlagrE      s+    )
++IN//f%r!   c                 n    [         [         S.nSnU R                  S[        R                  " US/S9UUS9  g)z|Adds a --network arg to the given parser.

Args:
  parser: argparse parser.
  required: bool whether arg is required or not
)rA   z	psa-rangea{          Network configuration for a Cloud NetApp Files Storage Pool. Specifying
        `psa-range` is optional.
        *name*::: The name of the Google Compute Engine
        [VPC network](/compute/docs/networks-and-firewalls#networks) to which
        the volume is connected. Short-form (VPC network ID) or long-form
        (full VPC network name: projects/PROJECT/locations/LOCATION/networks/NETWORK) are both
        accepted, but please use the long-form when attempting to create a Storage Pool using a shared VPC.
        *psa-range*::: This field is not implemented. The values provided in
        this field are ignored.
  z	--networkrA   )specrequired_keys)typer   helpN)stradd_argumentr   ArgDict)r9   r   network_arg_specnetwork_helps       r   AddStoragePoolNetworkArgrP      sJ     

, 	$4VHM	  r!   c                     [         R                  R                  S[        R                  " 5       SSS0S9R                  U 5        g)z2Adds a --active-directory arg to the given parser.z--active-directoryz3The Active Directory to attach to the Storage Pool.location flag_name_overridesN)r   ConceptParserForResourcer
   GetActiveDirectoryResourceSpecr8   r9   s    r    AddStoragePoolActiveDirectoryArgrZ      sA    ++**,;%r*	 , , -8K,?r!   c                     [         R                  R                  S[        R                  " 5       SSS0S9R                  U 5        g)z,Adds a --kms-config arg to the given parser.z--kms-configz-The KMS config to attach to the Storage Pool.rR   rS   rT   N)r   rV   rW   r
   GetKmsConfigResourceSpecr8   rY   s    r   AddStoragePoolKmsConfigArgr]      sA    ++$$&5%r*	 , , -8K,?r!   c                     U R                  S[        R                  " [        R                  [        R
                  S9SS9  g)z/Adds the --enable-ladp arg to the given parser.z--enable-ldaptruthy_stringsfalsey_stringszNBoolean flag indicating whether Storage Pool is a NFS LDAP Storage Pool or notrI   rJ   NrL   r   
ArgBooleannetapp_utiltruthyfalseyrY   s    r   AddStoragePoolEnableLdapArgrh      s;    !!$++K<N<NP_	  r!   c                     U R                  S[        R                  " [        R                  [        R
                  S9SS9  g)z6Adds the --allow-auto-tiering arg to the given parser.z--allow-auto-tieringr_   zKBoolean flag indicating whether Storage Pool is allowed to use auto-tieringrb   Nrc   rY   s    r   !AddStoragePoolAllowAutoTieringArgrj      s;    !!$++K<N<NP\	  r!   c                 .    U R                  S[        SS9  g)z$Adds the Zone arg to the arg parser.z--zonez1String indicating active zone of the Storage Poolrb   NrL   rK   rY   s    r   AddStoragePoolZoneArgrm      s    B  r!   c                 .    U R                  S[        SS9  g)z,Adds the Replica Zone arg to the arg parser.z--replica-zonez3String indicating replica zone for the Storage Poolrb   Nrl   rY   s    r   AddStoragePoolReplicaZoneArgro      s    D  r!   c                 .    U R                  S[        SS9  g)z6Adds the Directory Service Type arg to the arg parser.z--directory-service-typez=String indicating directory service type for the Storage Poolrb   Nrl   rY   s    r   %AddStoragePoolDirectoryServiceTypeArgrq      s     N  r!   c                     U R                  S[        R                  " [        R                  [        R
                  S9SS9  g)z:Adds the Custom Performance Enabled arg to the arg parser.z--custom-performance-enabledr_   zXBoolean flag indicating whether Storage Pool is a custom performance Storage Pool or notrb   Nrc   rY   s    r   )AddStoragePoolCustomPerformanceEnabledArgrs     s=    $!!$++K<N<N j  r!   c           	      R    U R                  S[        R                  " SSS/SS9SS9  g)	z0Adds the Total Throughput arg to the arg parser.z--total-throughputzMiB/szGiB/szB/sdefault_unitsuggested_binary_size_scales	type_abbrzThe total throughput of the Storage Pool in MiB/s or GiB/s units.
              If no throughput unit is specified, MiB/s is assumed.rb   NrL   r   
BinarySizerY   s    r    AddStoragePoolTotalThroughputArgr{     s:    !!(/'9
G  	r!   c                 .    U R                  S[        SS9  g)z*Adds the Total IOPS arg to the arg parser.z--total-iopsz1Integer indicating total IOPS of the Storage Poolrb   N)rL   intrY   s    r   AddStoragePoolTotalIopsArgr~     s    B  r!   c           	      P    U R                  S[        R                  " SS/SS9SS9  g)z-Adds the Hot Tier Size arg to the arg parser.z--hot-tier-sizeGiBBru   zThe hot tier size of the Storage Pool in GiB units.
              This is a required field when --allow-auto-tiering is set for flex service level.rb   Nry   rY   s    r   AddStoragePoolHotTierSizeArgr   (  s7    !!(-w
c  	r!   c                     U R                  S[        R                  " [        R                  [        R
                  S9SS9  g)z;Adds the Enable Hot Tier Auto Resize arg to the arg parser.z--enable-hot-tier-auto-resizer_   zSBoolean flag indicating whether Storage Pool is allowed to use hot tier auto resizerb   Nrc   rY   s    r   (AddStoragePoolEnableHotTierAutoResizeArgr   6  s=    %!!$++K<N<N e  r!   c                     U R                  S[        R                  " [        R                  [        R
                  S9SSS9  g)z)Adds the Unified Pool arg to the  parser.z--unified-poolr_   zBoolean flag indicating whether Storage Pool is a unified pool that supports BLOCK storage. Defaults to False if not specified.T)rI   rJ   hiddenNrc   rY   s    r   AddStoragePoolUnifiedPoolArgr   A  s@    !!$++K<N<N Q  r!   c                 L    [        U5      R                  R                  U 5        g )N)r.   r7   r8   )r9   r   s     r   AddStoragePoolQosTypeArgr   M  s    J{{6"r!   c                 ,   [         R                  " [        R                  " S5      /5      R	                  U 5        [        R
                  " U S5        [        R                  " U S5        [        R                  " U 5        [        R                  " U 5        [        R                  " US9n[        XSS9  [        U 5        [        U 5        [        U 5        [!        U 5        [#        U 5        [%        U 5        ['        U 5        [)        U 5        [+        U 5        [-        U 5        [/        X5        [1        X5        U[2        R4                  R6                  :X  d  U[2        R4                  R8                  :X  a"  [;        U 5        [=        U 5        [?        U 5        gg)z%Add args for creating a Storage Pool.zThe Storage Pool to create.Storage Poolrelease_trackT)r   r   N) r   rV   r
   GetStoragePoolPresentationSpecr8   AddResourceDescriptionArgAddResourceCapacityArgAddResourceAsyncFlagr   AddCreateLabelsFlagsnetapp_api_utilGetMessagesModuler>   rP   rZ   r]   rh   rm   ro   rj   rs   r{   r~   r;   r   r   ReleaseTrackALPHABETAr   r   r   r9   r   r   s      r   AddStoragePoolCreateArgsr   U  s.   **+HI! [!!&.9v~6V$""6*..]K($ 6""6*V$f%v&#F++F3"6*V$)6,t((...t((--- (,V4 ( .r!   c                     [         R                  " [        R                  " S5      /5      R	                  U 5        [        R
                  " U 5        g)z%Add args for deleting a Storage Pool.zThe Storage Pool to delete.Nr   rV   r
   r   r8   r   rY   s    r   AddStoragePoolDeleteArgsr   u  <    **+HI! [V$r!   c                    [         R                  " US9n[        R                  " [        R
                  " S5      /5      R                  U 5        [        R                  " U S5        [        R                  " U 5        [        R                  " U SSS9  [        R                  " U 5        [        U 5        [        U 5        [        U 5        [        U 5        [!        U 5        [#        X5        [%        U 5        U[&        R(                  R*                  :X  d  U[&        R(                  R,                  :X  a  [/        U 5        [1        U 5        gg)z%Add args for updating a Storage Pool.r   zThe Storage Pool to update.r   Fr=   N)r   r   r   rV   r
   r   r8   r   r   r   r   AddUpdateLabelsFlagsrZ   rm   ro   rj   r{   r   r~   r   r   r   r   r   r   r   s      r   AddStoragePoolUpdateArgsr   }  s    ..]K(**+HI! [!!&.9V$v~F""6*"6*v&#F+"6*6,V$t((...t((--- (,V4 .r!   c                     [         R                  " [        R                  " S5      /5      R	                  U 5        [        R
                  " U 5        g)z/Add args for switching zones of a Storage Pool.zThe Storage Pool to switch.Nr   rY   s    r   AddStoragePoolSwitchArgr     r   r!   c                     [         R                  " [        R                  " S5      /5      R	                  U 5        [        R
                  " U 5        [        U 5        g)z<Add args for validating directory service of a Storage Pool.zThe Storage Pool to validate.N)r   rV   r
   r   r8   r   rq   rY   s    r   )AddStoragePoolValidateDirectoryServiceArgr     sD    **+JK! [V$'/r!   N)T)F)2__doc__
__future__r   r   r   googlecloudsdk.api_lib.netappr   r   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr	   !googlecloudsdk.command_lib.netappr
   re   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   (googlecloudsdk.command_lib.util.conceptsr   STORAGE_POOLS_LIST_FORMATr    r*   r.   r1   r;   r>   rE   rP   rZ   r]   rh   rj   rm   ro   rq   rs   r{   r~   r   r   r   r   r   r   r   r   r    r!   r   <module>r      s    K &  ' A / ( 5 3 A : < D
	  2j *   %#&@@@	#)@%5.%0r!   