
                         T   d 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d
lmZ dd
lmZ dZ e
j&                  e
j(                  j*                  e
j(                  j,                  e
j(                  j.                         G d de
j0                               Zy)z:Command to unenroll an Anthos on bare metal admin cluster.    )absolute_import)division)unicode_literals)bare_metal_admin_clusters)
operations)base)parser_arguments)admin_cluster_flags)	constantsz
To unenroll an admin cluster named `my-cluster` managed in location `us-west1`,
run:

$ {command} my-cluster --location=us-west1
c                   H    e Zd ZdZdeiZedej                  fd       Z	d Z
y)UnenrollziUnenroll an Anthos on bare metal admin cluster so that it is no longer managed by the Anthos On-Prem API.EXAMPLESparserc                 >   | j                   j                  t        j                         t	        j
                  | d       t	        j                  |        t        j                  j                  |        t	        j                  |        t	        j                  |        y)z!Registers flags for this command.zto unenrollN)display_info	AddFormatbare_metal_constants BARE_METAL_ADMIN_CLUSTERS_FORMATcluster_flagsAddAdminClusterResourceArgAddAllowMissingClusterr   
ASYNC_FLAGAddToParserAddValidationOnlyAddIgnoreErrors)r   s    ;lib/surface/container/bare_metal/admin_clusters/unenroll.pyArgszUnenroll.Args-   so     !!== ,,V]C((0OO'##F+!!&)    c                    t        j                         }|j                  j                  j	                         }|j                  |      }|j                  r&|j                  d      st        j                  |_
        |j                  ry|j                  y|j                  r"t        j                  ||j                         |S t        j                         }|j!                  |      }t        j                  ||j                         |S )zRuns the unenroll command.formatN)apisAdminClustersClientCONCEPTSadmin_clusterParser   async_IsSpecifiedr   OPERATIONS_FORMATr    validate_onlynamer   log_unenrollOperationsClientWait)selfargscluster_clientcluster_ref	operationoperation_clientoperation_responses          r   RunzUnenroll.Run9   s    --/N----335K''-I{{4++H5//dk ~~{{k4;;7#446+00;k4;;7r   N)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr	   ArgumentInterceptorr   r5    r   r   r   r   %   s7     ry)-	*#77 	* 	* r   r   N)r9   
__future__r   r   r   *googlecloudsdk.api_lib.container.gkeonpremr   r!   r   googlecloudsdk.callioper   r	   /googlecloudsdk.command_lib.container.bare_metalr
   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremr:   ReleaseTracksReleaseTrackALPHABETAGACommandr   r>   r   r   <module>rJ      s    A &  ' X A ( 4 ` ] D	 T..33T5F5F5I5I) t|| ) ) r   