
    {                        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  \R                  \R                  " \R                  R                  5      \R                    " S S	\R"                  5      5       5       5       rg
)z5The update command for BigLake Iceberg REST catalogs.    )arg_parsers)util)base)flags)log)timesc                   .    \ rS rSrSr\S 5       rS rSrg)Failover   z(Failover a BigLake Iceberg REST catalog.c                     [         R                  " U S5        U R                  SSSS9  U R                  SSSS	S
9  U R                  SS[        R                  R
                  SS9  g )Nzto failoverz--primary-replicaTz*The primary replica region to failover to.)requiredhelpz--validate-onlyF
store_truez9If true, the failover will be validated but not executed.)r   actionr   z'--conditional-failover-replication-timea  If not specified, wait for all data from the source region to replicate to the new primary region before completing the failover, with no data loss. If specified, the failover will be executed immediately, accepting data loss of any data commited after the specified timestamp. This timestamp must be in UTC format, e.g. "2025-10-09T01:13:34.038262Z". See `$ gcloud topic datetimes` for more information.)r   typer   )r   AddCatalogResourceArgadd_argumentr   DatetimeParseUtcTime)parsers    0lib/surface/biglake/iceberg/catalogs/failover.pyArgsFailover.Args    s~    	6
9  
 H	   1!!..0      c                    [         R                  " U R                  5       5      nUR                  n[         R                  " UR
                  5      nUR                  UR                  S9nUR                  S5      (       a  UR                  Ul
        UR                  S5      (       a%  [        R                  " UR                  5      Ul        UR                  UUS9nUR                   R#                  U5      nUR                  (       a%  [$        R&                  " USUR                   S3S9  U$ [$        R&                  " USUR                   S3S9  U$ )	N)primaryReplicavalidate_only%conditional_failover_replication_time)namefailoverIcebergCatalogRequestzFailover to [z] validated.)detailsz] initiated.)r   GetClientInstanceReleaseTrackMESSAGES_MODULEGetCatalogNamecatalogFailoverIcebergCatalogRequestprimary_replicaIsSpecifiedr   validateOnlyr   FormatDateTimer   "conditionalFailoverReplicationTimeDBiglakeIcebergV1RestcatalogExtensionsProjectsCatalogsFailoverRequest3iceberg_v1_restcatalog_extensions_projects_catalogsr
   r   UpdatedResource)selfargsclientmessagescatalog_namefailover_requestrequestresponses           r   RunFailover.Run=   sH   ##D$5$5$78F%%H&&t||4L==++ >  ((&*&8&8#?@@


tII
J 9 [[&6 \ G
 	BBKK	
 
 	
!$"6"6!7|D O	 

!$"6"6!7|D Or    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r8   __static_attributes__r:   r   r   r
   r
      s     1 8#r   r
   N)r?   googlecloudsdk.callioper   googlecloudsdk.api_lib.biglaker   r   "googlecloudsdk.command_lib.biglaker   googlecloudsdk.corer   googlecloudsdk.core.utilr   HiddenReleaseTracksr#   ALPHADefaultUniverseOnlyCommandr
   r:   r   r   <module>rL      so    < / / ( 4 # * D%%++,Ct|| C  - Cr   