
    	                        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Z e
j(                  e
j*                  j,                        e
j.                   G d de
j0                                      Zy)z3Command to export an Anthos clusters on VMware API.    )absolute_import)division)unicode_literalsN)vmware_clusters)base)parser_arguments)flags)util)filesz
A cluster can be exported to a file by running:

  $ {command} NAME --destination=<path-to-file>

A cluster can also be exported to stdout by running:

  $ {command} NAME
c                   Z    e Zd ZdZdeiZedd       Zedej                  fd       Z
d Zy)	Exportz(Export an Anthos on VMware user cluster.EXAMPLESc                 4    t        j                  ddd|       S )N	gkeonpremv1VmwareClusterfor_help)export_utilGetSchemaPathr   s    /lib/surface/container/vmware/clusters/export.pyr   zExport.GetSchemaPath0   s    $$T?X     parserc                     t        j                  | d       t        j                  | t        j                  d             y )Nz	to exportTr   )schema_path)r	   AddClusterResourceArgr   AddExportFlagsr   r   )r   s    r   ArgszExport.Args6   s3    	4F00$0?r   c                    |j                   j                  j                         }t        j                         }|j                  |      }|j                  rOt        j                  |j                        5 }t        j                  ||| j                                d d d        y t        j                  |t        j                  | j                                y # 1 sw Y   y xY w)N)messagestreamr   )CONCEPTSclusterParseapisClustersClientDescribedestinationr   
FileWriterr   r   r   sysstdout)selfargscluster_refclientuser_clusterr!   s         r   Runz
Export.Run=   s    --''--/K  "F??;/LD,,- **,	
 .- ((* .-s   5'CC#N)F)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr   r   ArgumentInterceptorr   r1    r   r   r   r   )   sJ     1y)- 
 #77  r   r   )r5   
__future__r   r   r   r*   *googlecloudsdk.api_lib.container.gkeonpremr   r%   googlecloudsdk.callioper   r   +googlecloudsdk.command_lib.container.vmwarer	   !googlecloudsdk.command_lib.exportr
   r   googlecloudsdk.core.utilr   r6   ReleaseTracksReleaseTrackALPHAHiddenCommandr   r:   r   r   <module>rF      ss    : &  ' 
 N ( 4 = A *	 D%%++,#T\\ #  -#r   