
    V{              
          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rSrSr\\R4                  " S/ SQS9\S.rSSSSSSSSSS.	rSrSrS r S r!S r"S r#S  r$S! r%S" r&S6S# jr'S$ r(S% r)S& r*S' r+S( r,S) r-S* r.S+ r/S, r0S- r1S. r2S/ r3S0 r4S1 r5     S7S2 jr6S8S3 jr7S4 r8S5 r9g)9z=Flags and helpers for the Cloud Filestore instances commands.    )filestore_client)arg_parsers)base)
exceptions)concepts)flags)dp_util)resource_args)	arg_utils)labels_util)concept_parsersNa>      table(
      name.basename():label=INSTANCE_NAME:sort=1,
      name.segment(3):label=LOCATION,
      tier,
      fileShares[0].capacityGb:label=CAPACITY_GB,
      fileShares[0].name.yesno(no="N/A"):label=FILE_SHARE_NAME,
      networks[0].ipAddresses[0]:label=IP_ADDRESS,
      state,
      createTime.date()
    )a@      table(
      name.basename():label=INSTANCE_NAME:sort=1,
      name.segment(3):label=LOCATION,
      tier,
      protocol,
      capacityGb:label=CAPACITY_GB,
      fileShares[0].name.yesno(no="N/A"):label=FILE_SHARE_NAME,
      networks[0].ipAddresses[0]:label=IP_ADDRESS,
      state,
      createTime.date()
    )GB)r   GiBTBTiB)default_unitsuggested_binary_size_scales)namecapacityznfs-export-optionsBASIC
ENTERPRISEz
HIGH SCALEZONALREGIONAL)	TIER_UNSPECIFIEDSTANDARDPREMIUM	BASIC_HDD	BASIC_SSDr   HIGH_SCALE_SSDr   r   a          LDAP configuration for an instance. Specifies the domain name, servers,
        users-ou, and groups-ou to be created by the filestore instance. users-ou
        and groups-ou are optional.

         domain
            The desired domain name. i.e.:
            'my-domain.com'

          servers
            The desired LDAP servers. i.e.:
            'ldap.example.com', 'ldap2.example.com'

          users-ou
            The desired users Organizational Unit (OU).

          groups-ou
            The desired groups Organizational Unit (OU).

          Use the following format to specify the LDAP configuration:
            --ldap=^:^domain=my-domain.com:servers=ldap.example.com,ldap2.example.com:users-ou=users:groups-ou=groups
  a          Managed Active Directory configuration for an instance. Specifies both
        the domain name and a computer name (unique to the domain) to be created
        by the filestore instance.

         domain
            The desired domain full uri. i.e.:
            projects/PROJECT/locations/global/domains/DOMAIN

         computer
            The desired active directory computer name to be created by
            the filestore instance when connecting to the domain.
  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)r   	help_text)r    ResourceParameterAttributeConfigr   
ASYNC_FLAGAddToParserparserr"   s     ;lib/googlecloudsdk/command_lib/filestore/instances/flags.pyAddAsyncFlagr)   r   s+    )
++IN//f%    c                 *    SnU R                  SSUS9  g )NzPForces the deletion of an instance and its child resources,
  such as snapshots.z--force
store_true)actionhelpadd_argumentr&   s     r(   AddForceArgr1   y   s    )iIGr*   c                 ,    SnU R                  SSSUS9  g )NzkClears the NfsExportOptions. Must specify `--file-share`
  flag if --clear-nfs-export-options is specified.z--clear-nfs-export-optionsr,   Fr-   requiredr.   r/   r&   s     r(   AddClearNfsExportOptionsArgr5      s(    6)"	  r*   c                 D    [        [        5      nUR                  U S5      $ )Nr   )dictFILE_TIER_TO_TYPEget)instance_tier	tier_types     r(   GetTierTyper<      s    $%)	}g	..r*   c                 &    U R                  SSSS9  g )Nz
--locationFz3Location of the Cloud Filestore instance/operation.r4   r.   r/   r'   s    r(   AddLocationArgr@      s    @  r*   c                 &    U R                  SSSS9  g )Nz--regionFz'Region of the Cloud Filestore instance.r>   r/   r?   s    r(   AddRegionArgrB      s    5'P  r*   c            	          / SQn [         R                  " SS[        R                  " 5       [        R                  SR                  U 5      SS9$ )z(Makes the base.Argument for --tags flag.)z%List of tags KEY=VALUE pairs to bind.zEach item must be expressed asz4`<tag-key-namespaced-name>=<tag-value-short-name>`.
z?Example: `123/environment=production,123/costCenter=marketing`
z--tagsz	KEY=VALUE
F)metavartyper-   r.   hidden)r   Argumentr   ArgDictUpdateActionjoin)
help_partss    r(   
GetTagsArgrM      sF    * 
 %%99Z 
 r*   c                     [        X5      nU(       d  gU" [        [        R                  " U5      5       VVs/ s H  u  pEUR	                  XES9PM     snnS9$ s  snnf )zMakes the tags message object.N)keyvalue)additionalProperties)getattrsortedsix	iteritemsAdditionalProperty)argstags_messagetags_arg_nametagsrO   rP   s         r(   GetTagsFromArgsr[      s_    		%$		 #3==#677jc 
)
)c
)
?7
 s   A
c                 $    U R                  SSS9  g )Nz--descriptionz.A description of the Cloud Filestore instance.r.   r/   r?   s    r(   AddDescriptionArgr^      s    L  r*   c                     U R                   R                  R                  5       nU(       a  UR                  5       $ S H;  n[	        XR                  SS5      S5      (       d  M&  [        R                  " SS5      e   g)zDParse the KMS key resource arg, make sure the key format is correct.)zkms-keyzkms-keyringzkms-locationzkms-project-_Nz4--kms-project --kms-location --kms-keyring --kms-keyzSpecify fully qualified KMS key ID with --kms-key, or use combination of --kms-project, --kms-location, --kms-keyring and --kms-key to specify the key ID in pieces.)CONCEPTSkms_keyParseRelativeNamerR   replacer   InvalidArgumentException)rW   kms_refkeywords      r(   GetAndValidateKmsKeyNamerj      so    MM!!'')'!!Jgt__S#.55//
@7  K 
r*   c                 V    SR                  SS5      n[        R                  " U SUSS9  g )Nz{} must hold permission {}z-The 'Filestore Service Agent' service accountz)'Cloud KMS CryptoKey Encrypter/Decrypter'instanceF)r'   resourcepermission_infor4   )formatkms_resource_argsAddKmsKeyResourceArg)r'   rn   s     r(   AddKmsKeyArgrr      s4    07751/ ((%	r*   c           	      t    SSSSSSSSS	.n[         R                  " S
U R                  R                  SUSS9nU$ )zlAdds a --tier flag to the given parser.

Args:
  messages: The messages module.

Returns:
  the choice arg.
)standardziStandard Filestore instance, An alias for BASIC_HDD.
            Use BASIC_HDD instead whenever possible.)premiumznPremium Filestore instance, An alias for BASIC_SSD.
                  Use BASIC_SSD instead whenever possible.)z	basic-hddz(Performant NFS storage system using HDD.)z	basic-ssdz(Performant NFS storage system using SSD.)
enterprisezHEnterprise instance.
            Use REGIONAL instead whenever possible.)zhigh-scale-ssdz]High Scale SSD instance, an alias for ZONAL.
            Use ZONAL instead whenever possible.)zonalzZonal instances offer NFS storage            system suitable for high performance computing application            requirements. It offers fast performance that scales            with capacity and allows you to grow and shrink            capacity.)regionalzfRegional instances offer the features          and availability needed for mission-critical workloads.)r   r   r   r   r   r   r   r   z--tierzThe service tier for the Cloud Filestore instance.
       For more details, see:
       https://cloud.google.com/filestore/docs/instance-tiers r   help_strcustom_mappingsdefault)r   ChoiceEnumMapperInstanceTierValueValuesEnum)messagesr{   tier_args      r(   
GetTierArgr      sj    

 ML

?$/J ''++B &( 
/r*   c                 d    [         R                  " SU R                  R                  SSSS.SS9nU$ )zCreates a --protocol flag spec for the arg parser.

Args:
  messages: The messages module.

Returns:
  The chosen protocol arg.
z
--protocolz6The service protocol for the Cloud Filestore instance.)znfs-v3zNFSv3 protocol.)znfs-v4-1zNFSv4.1 protocol.)NFS_V3NFS_V4_1r   ry   )r   r}   r~   ProtocolValueValuesEnum)r   protocol_args     r(   GetProtocolArgr     sA     ++//G17 	, 
r*   c                 d    [         R                  " SU R                  R                  SSSS.SS9nU$ )zCreates a --backendType flag spec for the arg parser.

Args:
  messages: The messages module.

Returns:
  The chosen backendType arg.
z--backend-typez:The service backend type for the Cloud Filestore instance.)zcompute-based-backendzCompute based backend.)zfilestore-backendzFilestore backend.)COMPUTE_BASED_BACKENDFILESTORE_BACKENDT)rz   r{   rG   )r   r}   r~   BackendTypeValueValuesEnum)r   backend_type_args     r(   GetBackendTypeArgr   1  sH       




6
6O-)   
r*   c                 t    [         [         S.nU R                  S[        R                  " USS/S9S[        S9  g)	zJAdds a --managed-ad flag to the parser.

Args:
  parser: argparse parser.
)domaincomputerz--managed-adr   r   specrequired_keysFrF   r4   r.   N)strr0   r   rI   _MANAGED_AD_HELP_TEXT)r'   managed_ad_arg_specs     r(   #AddConnectManagedActiveDirectoryArgr   L  sJ     
 	"8Z2H    r*   c           	          [         [         [         [         S.nU R                  SS[        R                  " USS/S9S[        SS	9  g
)zDAdds a --ldap flag to the parser.

Args:
  parser: argparse parser.
)r   serverszusers-ouz	groups-ouz--ldapzL^:^domain=DOMAIN:servers=SERVER1,SERVER2:users-ou=USERSOU:groups-ou=GROUPSOUr   r   r   FT)rE   rF   r4   r.   rG   N)r   r0   r   rI   _LDAP_HELP_TEXT)r'   ldap_arg_specs     r(   AddConnectLdapArgr   b  sV     	- 	\!9-   
r*   c                 .    SnU R                  SSSSUS9  g)zOAdds a --disconnect-ldap flag to the parser.

Args:
  parser: argparse parser.
z*        Disconnect the instance from LDAP.z--disconnect-ldapr,   FT)r-   r4   rG   r.   Nr/   )r'   disconnect_ldap_helps     r(   AddDisconnectLdapArgr   }  s.    . 	  r*   c                     U[         R                  :X  a  gU[         R                  :X  a(  U R                  SSSS9n[	        U5        [        U5        g[        U 5        g)zAdds --managed-ad and --ldap flags to the parser.

Args:
  parser: argparse parser.
  api_version: filestore_client api version.
Nz1Directory services configuration for an instance.FT)r.   r4   mutex)r   ALPHA_API_VERSIONBETA_API_VERSION	add_groupr   r   )r'   api_versiongroups      r(   AddDirectoryServicesArgr     s_     $666
&777@  E (.e fr*   c                 ,    SnU R                  SSSUS9  g)zUAdds a --disconnect-managed-ad flag to the parser.

Args:
  parser: argparse parser.
z>        Disconnect the instance from Managed Active Directory.z--disconnect-managed-adr,   Fr3   Nr/   )r'   disconnect_managed_ad_helps     r(   &AddDisconnectManagedActiveDirectoryArgr     s,     B 	%	  r*   c                     U R                  U[        R                  :H  S9nU[        R                  :X  a  [	        U5        [        U5        [        U5        [        U5        g)zAdds --managed-ad, --disconnect-managed-ad, --ldap, --disconnect-ldap flags to the parser.

Args:
  parser: argparse parser.
  api_version: filestore_client api version.
)rG   N)add_mutually_exclusive_groupr   V1_API_VERSIONr   r   r   r   r   )r'   r   connection_arg_groups      r(   )AddDirectoryServicesConnectDisconnectArgsr     s^      <<,;;; =  $555'(<=*+?@()+,r*   c                 &    U R                  SSSS9  g )Nz--source-instanceFz@The replication source instance of the Cloud Filestore instance.r>   r/   r?   s    r(   AddSourceInstanceArgr     s    M  r*   c                    [         [         [         S.n[         [         [         [         [         S.n[        R                  U[        R                  U[        R                  U0nSnSn[        R                  U[        R                  U[        R                  U0nU R                  S[        R                  " XA   S/S9SXq   S	9  g
)zzAdds a --network flag to the given parser.

Args:
  parser: argparse parser.
  api_version: filestore_client api version.
)r   reserved-ip-rangeconnect-mode)r   r   r   zaddress-modezpsc-endpoint-projecta          Network configuration for a Cloud Filestore instance. Specifying
        `reserved-ip-range` and `connect-mode` is optional.
        *name*::: The name of the Google Compute Engine
        [VPC network](/compute/docs/networks-and-firewalls#networks) to which
        the instance is connected.
        *reserved-ip-range*::: The `reserved-ip-range` can have one of the
        following two types of values: a CIDR range value when using
        DIRECT_PEERING connect mode or an allocated IP address range
        (https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
        when using PRIVATE_SERVICE_ACCESS connect mode. When the name of an
        allocated IP address range is specified, it must be one of the ranges
        associated with the private service access connection. When specified as
        a direct CIDR value, it must be a /29 CIDR block for Basic tier or a /24
        CIDR block for High Scale, Zonal, Enterprise or Regional tier in one of the internal IP
        address ranges (https://www.arin.net/knowledge/address_filters.html)
        that identifies the range of IP addresses reserved for this instance.
        For example, 10.0.0.0/29 or 192.168.0.0/24. The range you specify can't
        overlap with either existing subnets or assigned IP address ranges for
        other Cloud Filestore instances in the selected VPC network.
        *connect-mode*::: Network connection mode used by instances.
        CONNECT_MODE must be one of: DIRECT_PEERING or PRIVATE_SERVICE_ACCESS.
  a          Network configuration for a Cloud Filestore instance. Specifying
        `reserved-ip-range`, `address-mode` and `connect-mode` is optional.
        *name*::: The name of the Google Compute Engine
        [VPC network](/compute/docs/networks-and-firewalls#networks) to which
        the instance is connected.
        *reserved-ip-range*::: The `reserved-ip-range` can have one of the
        following two types of values: a CIDR range value when using
        DIRECT_PEERING connect mode or an allocated IP address range
        (https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
        when using PRIVATE_SERVICE_ACCESS connect mode. When the name of an
        allocated IP address range is specified, it must be one of the ranges
        associated with the private service access connection. When specified as
        a direct CIDR value, it must be a /29 CIDR block for Basic tier or a /24
        CIDR block for High Scale, Zonal, Enterprise or Regional tier in one of the internal IP
        address ranges (https://www.arin.net/knowledge/address_filters.html)
        that identifies the range of IP addresses reserved for this instance.
        For example, 10.0.0.0/29 or 192.168.0.0/24. The range you specify can't
        overlap with either existing subnets or assigned IP address ranges for
        other Cloud Filestore instances in the selected VPC network.
        *connect-mode*::: Network connection mode used by instances.
        CONNECT_MODE must be one of: DIRECT_PEERING, PRIVATE_SERVICE_ACCESS or
        PRIVATE_SERVICE_CONNECT.
        *address-mode*::: Internet protocol version for which the instance has IP address assigned.
        *psc-endpoint-project*::: Consumer service project in which the psc
        endpoint would be set up. This is optional, and only relevant in case
        the network is a shared VPC. If this is not specified, the psc endpoint
        would be setup in the VPC host project.
  z	--networkr   r   Tr   N)r   r   r   r   r   r0   r   rI   )r'   r   network_arg_spec_alphanetwork_arg_spec_beta_v1network_arg_specnetwork_help_alphanetwork_help_beta_v1network_helps           r(   AddNetworkArgr     s      ! %%'?((*@'')A0> %%';((*<'')=, 	,VH $  r*   c                 l   Sn[         R                  S[         R                  U[         R                  U0nSn	Sn
[        R                  5       nU(       a  [        US'   [        US'   U(       a  [        US'   [        US'   U(       a	  [        US	'   X   nU(       a\  S
nU R                  SS9n[        U5        UR                  S[        R                  " USS/S9UUU(       a  U	OS-   U(       a  U
OS-   S9  gU R                  S[        R                  " USS/S9UUU(       a  U	OS-   U(       a  U
OS-   S9  g)a  Adds a --file-share flag to the given parser.

Args:
  parser: argparse parser.
  api_version: filestore_client api version.
  include_snapshot_flags: bool, whether to include --source-snapshot flags.
  include_backup_flags: bool, whether to include --source-backup flags.
  include_backupdr_flags: bool, whether to include --source-backupdr-backup
  flag.
  clear_nfs_export_options_required: bool, whether to include
    --clear-nfs-export-options flags.
  required: bool, passthrough to parser.add_argument.
a  
File share configuration for an instance. Specifying both `name` and `capacity`
is required.

*capacity*::: The desired capacity of the volume in GB or TB units. If no capacity
unit is specified, GB is assumed. Acceptable instance capacities for each tier are as follows:
* BASIC_HDD: 1TB-63.9TB in 1GB increments or its multiples.
* BASIC_SSD: 2.5TB-63.9TB in 1GB increments or its multiples.
* HIGH_SCALE_SSD: 10TB-100TB in 2.5TB increments or its multiples.
* ZONAL: 1TB-100TB:
  - 1TB-9.75TB in 256GB increments or its multiples.
  - 10TB-100TB in 2.5TB increments or its multiples.
* ENTERPRISE: 1TB-10TB in 256GB increments or its multiples.
* REGIONAL: 1TB-100TB:
  - 1TB-9.75TB in 256GB increments or its multiples.
  - 10TB-100TB in 2.5TB increments or its multiples.

*name*::: The desired logical name of the volume.

*nfs-export-options*::: The NfsExportOptions for the Cloud Filestore instance file share.
Configuring NfsExportOptions is optional and can only be set using flags-file. Use the `--flags-file`
flag to specify the path to a JSON or YAML configuration file that contains the required NfsExportOptions flags.

*ip-ranges*::: A list of IPv4 addresses or CIDR ranges that are allowed to mount the file share.
IPv4 addresses format: {octet 1}.{octet 2}.{octet 3}.{octet 4}.
CIDR range format: {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size}.
Overlapping IP ranges are allowed for all tiers other than BASIC_HDD and
BASIC_SSD. The limit of IP ranges/addresses for each FileShareConfig among all
NfsExportOptions is 64 per instance.

*access-mode*::: The type of access allowed for the specified IP-addresses or CIDR ranges.
READ_ONLY: Allows only read requests on the exported file share.
READ_WRITE: Allows both read and write requests on the exported file share.
The default setting is READ_WRITE.

*squash-mode*::: Enables or disables root squash for the specified
IP addresses or CIDR ranges.
NO_ROOT_SQUASH: Disables root squash to allow root access on the exported file share.
ROOT_SQUASH. Enables root squash to remove root access on the exported file share.
The default setting is NO_ROOT_SQUASH.

*anon_uid*::: An integer that represents the user ID of anonymous users.
Anon_uid may only be set when squash_mode is set to ROOT_SQUASH.
If NO_ROOT_SQUASH is specified, an error will be returned.
The default value is 65534.

*anon_gid*::: An integer that represents the group ID of anonymous groups.
Anon_gid may only be set when squash_mode is set to ROOT_SQUASH.
If NO_ROOT_SQUASH is specified, an error will be returned.
The default value is 65534.

*security-flavors*:: A list of security flavors that are allowed to be used
during mount command in NFSv4.1 filestore instances.
The security flavors supported are:
- SECURITY_FLAVOR_UNSPECIFIED: SecurityFlavor not set. Defaults to AUTH_SYS.
- AUTH_SYS: The user's UNIX user-id and group-ids are passed in the clear.
- KRB5: The end-user authentication is done using Kerberos V5.
- KRB5I: KRB5 plus integrity protection (data packets are tamper proof).
- KRB5P: KRB5I plus privacy protection (data packets are tamper proof and
  encrypted).

*network*::: The source VPC network for `ip-ranges`. Required for instances using
Private Service Connect, optional otherwise. If provided, must be the same
network specified in the `network.name` field.
a
  File share configuration for an instance.  Specifying both `name` and `capacity`
is required.

*capacity*::: The desired capacity of the volume in GB or TB units. If no capacity
unit is specified, GB is assumed. Acceptable instance capacities for each tier are as follows:
* BASIC_HDD: 1TB-63.9TB in 1GB increments or its multiples.
* BASIC_SSD: 2.5TB-63.9TB in 1GB increments or its multiples.
* HIGH_SCALE_SSD: 10TB-100TB in 2.5TB increments or its multiples.
* ZONAL: 1TB-100TB:
  - 1TB-9.75TB in 256GB increments or its multiples.
  - 10TB-100TB in 2.5TB increments or its multiples.
* ENTERPRISE: 1TB-10TB in 256GB increments or its multiples.
* REGIONAL: 1TB-100TB:
  - 1TB-9.75TB in 256GB increments or its multiples.
  - 10TB-100TB in 2.5TB increments or its multiples.

*name*::: The desired logical name of the volume.

*nfs-export-options*::: The NfsExportOptions for the Cloud Filestore instance file share.
Configuring NfsExportOptions is optional and can only be set using flags-file. Use the `--flags-file`
flag to specify the path to a JSON or YAML configuration file that contains the required NfsExportOptions flags.

*ip-ranges*::: A list of IPv4 addresses or CIDR ranges that are allowed to mount the file share.
IPv4 addresses format: {octet 1}.{octet 2}.{octet 3}.{octet 4}.
CIDR range format: {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size}.
Overlapping IP ranges are allowed for all tiers other than BASIC_HDD and
BASIC_SSD. The limit of IP ranges/addresses for each FileShareConfig among all
NfsExportOptions is 64 per instance.

*access-mode*::: The type of access allowed for the specified IP-addresses or CIDR ranges.
READ_ONLY: Allows only read requests on the exported file share.
READ_WRITE: Allows both read and write requests on the exported file share.
The default setting is READ_WRITE.

*squash-mode*::: Enables or disables root squash for the specified
IP addresses or CIDR ranges.
NO_ROOT_SQUASH: Disables root squash to allow root access on the exported file share.
ROOT_SQUASH. Enables root squash to remove root access on the exported file share.
The default setting is NO_ROOT_SQUASH.

*anon_uid*::: An integer that represents the user ID of anonymous users.
Anon_uid may only be set when squash_mode is set to ROOT_SQUASH.
If NO_ROOT_SQUASH is specified, an error will be returned.
The default value is 65534.

*anon_gid*::: An integer that represents the group ID of anonymous groups.
Anon_gid may only be set when squash_mode is set to ROOT_SQUASH.
If NO_ROOT_SQUASH is specified, an error will be returned.
The default value is 65534.
a  
*source-snapshot*::: The name of the snapshot to restore from. Supported for BASIC instances only.

*source-snapshot-region*::: The region of the source snapshot. If
unspecified, it is assumed that the Filestore snapshot is local and
instance-zone will be used.

zy
*source-backup*::: The name of the backup to restore from.

*source-backup-region*::: The region of the source backup.

zsource-backupzsource-backup-regionzsource-snapshotzsource-snapshot-regionzsource-backupdr-backupTzParameters for file-share.r]   z--file-sharer   r   r    r   N)r   r   r   r   FILE_SHARE_ARG_SPECcopyr   add_argument_groupr5   r0   r   rI   )r'   r   include_snapshot_flagsinclude_backup_flagsinclude_backupdr_flags!clear_nfs_export_options_requiredr4   alpha_beta_help_textfile_share_helpsource_snapshot_helpsource_backup_helpr   file_share_arg_groups                r(   AddFileShareArgr   :  sm   ,@F %% 2(f ((*>'')=k6/n 
	!	!	#$D#&D	 !D	%(D	!"%(D	!"#0/&H!44) 5    45%%  d6::NO#9rC!52?	 &    d6::NO#9rC!52?	  r*   c                     Sn[         R                  " S5      [         R                  " S5      S.nU R                  S[         R                  " USS9UUS9  g)zmAdds a --performance flag to the given parser.

Args:
  parser: argparse parser.
  hidden: if hidden or not.
a          Performance configuration for the instance. This flag is used
        to configure the read IOPS provisioned for the instance. The
        instance's write IOPS and read/write throughputs will be derived from the
        configured read IOPS. For more information about the derived performance
        limits and default performance see: https://cloud.google.com/filestore/docs/performance.
        Must be one of:

          max-iops
            The number of IOPS to provision for the instance.
            MAX-IOPS must be in multiple of 1000 and in the supported IOPS
            range for the current capacity of the instance.
            For more details, see: https://cloud.google.com/filestore/docs/performance.

          max-iops-per-tb
            Is used for setting the max IOPS of the instance by
            specifying the IOPS per TB. When this parameter is used, the
            max IOPS are derived from the instance capacity:
            The instance max IOPS will be calculated by multiplying the
            capacity of the instance (TB) by MAX-IOPS-PER-TB, and rounding
            to the nearest 1000. The max IOPS will be changed
            dynamically based on the instance capacity.
            MAX-IOPS-PER-TB must be in the supported range of the instance.
            For more details, see: https://cloud.google.com/filestore/docs/performance.


        Examples:

        Configure an instance with `max-iops` performance:

          $ {command} example-cluster --performance=max-iops=17000

        Configure an instance with `max-iops-per-tb` performance:

          $ {command} example-cluster --performance=max-iops-per-tb=17000
     )zmax-iopszmax-iops-per-tbz--performance)r   
max_length)rF   r.   rG   N)r   
BoundedIntr0   rI   )r'   rG   performance_helpperformance_arg_specs       r(   AddPerformanceArgr     s`    #L ((+$//2
 	$8QG	  r*   c                    [         R                  " [        R                  " S5      /5      R	                  U 5        [        U 5        [        U 5        [        U 5        [        U 5        [        R                  " U 5        [        X5        [        R                  " US9n[        U5      R                  R	                  U 5        U[        R                   [        R"                  4;   a/  [%        U5      R                  R	                  U 5        ['        X5        U[        R                   4;   a$  [)        U5      R                  R	                  U 5        [+        U UU[        R,                  :H  SU[        R,                  :g  S9  U[        R                   [        R"                  4;   aQ  [/        U 5        [1        U 5        [3        U 5        [5        5       R	                  U 5        [6        R8                  " U 5        gg)z"Add args for creating an instance.zThe instance to create.)versionT)r   r   r   N)r   ConceptParserr   GetInstancePresentationSpecr%   r^   r@   rB   r)   r   AddCreateLabelsFlagsr   r   GetMessagesr   
choice_argr   r   r   r   r   r   r   rr   r   r   rM   r	   AddDeletionProtectionCreateArgs)r'   r   r   s      r(   AddInstanceCreateArgsr   7  s   (()BCDKFvv""6*$))+>(X!!--f5''%%  8''33F;F0''  h**66v>
);;
;(,<,N,NN ''%%   fLV$++F3r*   c                    [         R                  " [        R                  " S5      /5      R	                  U 5        [        U 5        [        U 5        [        U 5        [        U 5        [        R                  " U 5        [        U UU[        R                  :H  SSS9  U[        R                  [        R                  4;   a-  [!        X5        [#        U 5        [$        R&                  " U 5        gg)z"Add args for updating an instance.zThe instance to update.TF)r   r   r4   N)r   r   r   r   r%   r^   r@   rB   r)   r   AddUpdateLabelsFlagsr   r   r   r   r   r   r   r	   AddDeletionProtectionUpdateArgs)r'   r   s     r(   AddInstanceUpdateArgsr   c  s    (()BCDKFvv""6*
);;
;(, ''%%  .fBf++F3r*   )rZ   )FFFFT)F):__doc__ googlecloudsdk.api_lib.filestorer   googlecloudsdk.callioper   r   r    googlecloudsdk.calliope.conceptsr   $googlecloudsdk.command_lib.filestorer   .googlecloudsdk.command_lib.filestore.instancesr	   googlecloudsdk.command_lib.kmsr
   rp   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   (googlecloudsdk.command_lib.util.conceptsr   rT   INSTANCES_LIST_FORMAT_V1_ALPAHINSTANCES_LIST_FORMAT_BETAr   
BinarySizelistr   r8   r   r   r)   r1   r5   r<   r@   rB   rM   r[   r^   rj   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r*   r(   <module>r      s4   D = / ( . 5 6 B M : < D 

"	 	  &&%?    "
 . &H/
$"
7t,6,6&4$-(_J ! &+AH6r)4X4r*   