
                            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SKJr  SS0r\R,                  " \R.                  R0                  5      \R2                   " S S\R4                  5      5       5       r\R,                  " \R.                  R8                  \R.                  R:                  5       " S S\5      5       rg)z:AI Platform index endpoints mutate-deployed-index command.    )absolute_import)division)unicode_literals)encoding)
operations)client)base)	constants)endpoint_util)flags)index_endpoints_util)operations_util)logEXAMPLESa          To mutated a deployed index ``deployed-index-123'' from an index
        endpoint ``456'' with 2 min replica count and 10 max replica count under
        project ``example'' in region ``us-central1'', within
        ``vertex-ai-ip-ranges-1'' and ``vertex-ai-ip-ranges-2'', within
        deployment group ``test'', enabling access logging, with JWT audiences
        ``aud1'' and ``aud2'', JWT issuers ``issuer1'' and ``issuer2'' run:

          $ {command} 456 --project=example --region=us-central1 --deployed-index-id=deployed-index-123 --min-replica-count=2 --max-replica-count=10 --reserved-ip-ranges=vertex-ai-ip-ranges-1,vertex-ai-ip-ranges-2 --enable-access-logging --audiences=aud1,aud2 --allowed-issuers=issuer1,issuer2 --deployment-group=test
        c                   8    \ rS rSrSr\r\S 5       rS r	S r
Srg)MutateDeployedIndexV1/   BMutate an existing deployed index from a Vertex AI index endpoint.c                 x   [         R                  " U S5        [         R                  " 5       R                  U 5        [         R                  " U S5        [         R
                  " U S5        [         R                  " U 5        [         R                  " U S5        [         R                  " 5       R                  U 5        g )NzID of the index endpoint.zdeployed index)	r   AddIndexEndpointResourceArgGetDeployedIndexIdAddToParserAddDeploymentResourcesArgsAddReservedIpRangesArgsAddDeploymentGroupArgAddAuthConfigArgsGetEnableAccessLoggingArg)parsers    7lib/surface/ai/index_endpoints/mutate_deployed_index.pyArgsMutateDeployedIndexV1.Args6   s    	%%f.IJ	**62	$$V-=>	!!&*:;	'	F$45	##%11&9    c                    UR                   R                  R                  5       nUR                  5       S   n[        R
                  " X$S9   [        R                  " US9nU[        R                  :X  a  UR                  X15      nOUR                  X15      n[        R                  " [        R                  " US9U[         R"                  " UR$                  5      S9nS S S 5        WbY  [&        R(                  " U5      nSU;   a=  SUS   ;   a4  [*        R,                  R/                  SR1                  US   S   5      5        U$ ! , (       d  f       Nl= f)NlocationsId)region)version)operations_clientopop_refdeployedIndexidz%Id of the deployed index updated: {}.)CONCEPTSindex_endpointParseAsDictr   AiplatformEndpointOverridesr   IndexEndpointsClientr
   
GA_VERSIONMutateDeployedIndexMutateDeployedIndexBetar   WaitForOpMayber   OperationsClientr   ParseIndexEndpointOperationnamer   MessageToPyValuer   statusPrintformat)	selfargsr&   index_endpoint_refr%   index_endpoint_client	operationresponse_msgresponses	            r   _RunMutateDeployedIndexV1._Run@   s*   55;;=&&(7F		2	27	J$99'J	I((	()==&	 *AA&	 %33&77H%AAnnl 
K **<8h	H	$/1J)J

AII_%d+- 	.' 
K	Js   BE
Ec                 B    U R                  U[        R                  5      $ N)rD   r
   r2   r=   r>   s     r   RunMutateDeployedIndexV1.RunX   s    99T9//00r"    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr    rD   rI   __static_attributes__rK   r"   r   r   r   /   s)     K-: :01r"   r   c                   "    \ rS rSrSr\rS rSrg)MutateDeployedIndexV1Beta1\   r   c                 B    U R                  U[        R                  5      $ rG   )rD   r
   BETA_VERSIONrH   s     r   rI   MutateDeployedIndexV1Beta1.Runb   s    99T91122r"   rK   N)	rL   rM   rN   rO   rP   rQ   rR   rI   rT   rK   r"   r   rV   rV   \   s    J-3r"   rV   N)rP   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.air   )googlecloudsdk.api_lib.ai.index_endpointsr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.air
   r   r   r   r   googlecloudsdk.corer   rQ   ReleaseTracksReleaseTrackGADefaultUniverseOnlyCommandr   ALPHABETArV   rK   r"   r   <module>ri      s    A &  ' % 0 < ( 3 7 / > 9 # 		 D%%(()(1DLL (1  *(1V D%%++T->->-C-CD3!6 3 E3r"   