
    	                        S r SSK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
\R                   " S5      S.r\R$                  " \R&                  R(                  \R&                  R*                  \R&                  R,                  5      \R.                   " S S\R0                  5      5       5       rg)z(Exports a Gcloud Deploy target resource.    N)
exceptions)base)export_util)manifest_util)resource_args)target_util)utilz{description}z
      To return the .yaml definition of the target 'test-target' in region 'us-central1', run:

        $ {command} test-target --region=us-central1

      )DESCRIPTIONEXAMPLESc                   p    \ rS rSrSr\r\S 5       r\	R                  " \R                  5      S 5       rSrg)Export+   z~Returns the .yaml definition of the specified target.

The exported YAML definition can be applied by 'deploy apply' command.
c                 Z    [         R                  " U SS9  [        R                  " U 5        g )NT)
positional)r   AddTargetResourceArgcore_export_utilAddExportFlags)parsers    $lib/surface/deploy/targets/export.pyArgsExport.Args5   s     &&v$?##F+    c                    UR                   R                  R                  5       n[        R                  " U5      n[
        R                  " X2[
        R                  R                  5      n[        R                  " XA5        g)zEntry point of the export command.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.
N)CONCEPTStargetParser   	GetTargetr   ProtoToManifestResourceKindTARGETr   r   )selfargs
target_ref
target_objmanifests        r   Run
Export.Run:   s^     %%++-J&&z2J,,Z-:-G-G-N-NPH x&r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr&   __static_attributes__r(   r   r   r   r   +   sH     !-, , 44))''r   r   )r-   textwrapgooglecloudsdk.api_lib.utilr   r1   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr3   r   r   r   r   !googlecloudsdk.command_lib.exportr	   r   dedentr.   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyExportCommandr   r(   r   r   <module>rC      s    /  F ( M 9 ; ; 9 F 	 
 		 D%%++T->->-C-C%%((*'T ' *'r   