
    :                        d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ dd	l
mZ dd
lmZ ddlmZ ddlmZ ddlmZ dZdZ e	j*                  e	j,                  j.                         G d de	j0                               Z e	j*                  e	j,                  j4                  e	j,                  j6                         G d de             Zy)z5Command to reboot a Persistent Resource in Vertex AI.    )absolute_import)division)unicode_literalsN)client)base)	constants)endpoint_util)flags)
validation)log)
propertiesz?projects/{project}/locations/{region}/operations/{operation_id}zRequest to reboot the PersistentResource [{name}] has been sent.

You may view the status of your PersistentResource reboot operation with the command

  $ {command_prefix} ai operations describe {operation_resource_name}

c                   D    e Zd ZdZej
                  Zed        Zd Z	d Z
y)RebootGAzReboot a Persistent Resource.

  ## EXAMPLES

  To reboot a persistent resource ``123'' under project ``example'' in region
  ``us-central1'', run:

    $ {command} 123 --project=example --region=us-central1
  c                 0    t        j                  | d       y )Nz	to reboot)r
    AddPersistentResourceResourceArg)parsers    -lib/surface/ai/persistent_resources/reboot.pyArgszRebootGA.Args:   s    	**6;?    c                 ~    d}| j                         j                  r |d| j                         j                  z   z  }|S )Ngcloud )ReleaseTrackprefix)self
cmd_prefixs     r   _CommandPrefixzRebootGA._CommandPrefix>   s=    J!!C$++-4444jr   c                    |j                   j                  j                         }|j                         d   }t	        j
                  |       t        j                  | j                  |      5  t        j                  j                  j                  j                         }|j                         }t        j                   | j                        j#                  |      }t%        j&                  d|j(                        j+                  d      d   }t,        j/                  |||      }t0        j2                  j5                  t6        j/                  || j9                         |             |cd d d        S # 1 sw Y   y xY w)NlocationsId)versionregion)r    zoperations\/(\d+)r   )projectr!   operation_id)namecommand_prefixoperation_resource_name)CONCEPTSpersistent_resourceParseAsDictr   ValidateRegionr	   AiplatformEndpointOverrides_api_versionr   VALUEScorer"   	GetOrFailRelativeNamer   PersistentResourcesClientRebootresearchr$   groups!_OPERATION_RESOURCE_NAME_TEMPLATEformatr   statusPrint+_PERSISTENT_RESOURCE_REBOOT_DISPLAY_MESSAGEr   )	r   argspersistent_resource_refr!   r"   resource_nameresponser#   r&   s	            r   RunzRebootGA.RunD   s?   "mm??EEG$++-m<Ff%		2	2!!&
2!!&&..88:g-::<m11##%%+VM%:  YY3X]]CJJ1MaPl A H H# !I ! 
jj
5
<
< !002&= = ?@
 '
2 
2 
2s   .D E88FN)__name__
__module____qualname____doc__r   
GA_VERSIONr-   staticmethodr   r   r@    r   r   r   r   -   s2     %%,@ @r   r   c                   (    e Zd ZdZej
                  Zy)RebootPreGAzReboot an active Persistent Resource.

  ## EXAMPLES

  To reboot a persistent resource ``123'' under project ``example'' in region
  ``us-central1'', run:

    $ {command} 123 --project=example --region=us-central1
  N)rA   rB   rC   rD   r   BETA_VERSIONr-   rG   r   r   rI   rI   _   s     '',r   rI   )rD   
__future__r   r   r   r4   .googlecloudsdk.api_lib.ai.persistent_resourcesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   2googlecloudsdk.command_lib.ai.persistent_resourcesr
   r   googlecloudsdk.corer   r   r7   r;   ReleaseTracksr   GASilentCommandr   ALPHABETArI   rG   r   r   <module>rV      s    < &  ' 	 A ( 3 7 D I # * F "/ + D%%(().t!! . *.b D%%++T->->-C-CD
(( 
( E
(r   