
    		                         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
  SSK	Jr  SS	KJr  \R                  " \R                  R                   5       " S
 S\R"                  5      5       rg)z#Export revision state file command.    )absolute_import)division)unicode_literals)configmanager_util)base)deploy_util)resource_args)concept_parsersc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	ExportStatefile   zhExport a terraform state file.

This command generates a signed url to download a terraform state file.
EXAMPLESz
        Export state file for revision `projects/p1/locations/l1/deployments/d1/revisions/r-0`:

          $ {command} projects/p1/locations/l1/deployments/d1/revisions/r-0

      c                 x    [         R                  " [        R                  " S5      /5      R	                  U 5        g )Nz"the revision to be used as parent.)r
   ConceptParserr	   GetRevisionResourceArgSpecAddToParser)parsers    7lib/surface/infra_manager/revisions/export_statefile.pyArgsExportStatefile.Args*   s2    !!444	
 k&    c                     [         R                  " 5       nUR                  R                  R	                  5       nUR                  5       n[        R                  " UU5      $ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  The statefile containing signed url that can be used to upload state file.
)r   GetMessagesModuleCONCEPTSrevisionParseRelativeNamer   ExportRevisionStateFile)selfargsmessagesrevision_refrevision_full_names        r   RunExportStatefile.Run4   sR     "335H==))//1L%224.. r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r$   __static_attributes__r&   r   r   r   r      s1    
   
 -  r   r   N)r+   
__future__r   r   r   $googlecloudsdk.api_lib.infra_managerr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.infra_managerr   r	   (googlecloudsdk.command_lib.util.conceptsr
   ReleaseTracksReleaseTrackGACommandr   r&   r   r   <module>r8      sX    * &  ' C ( @ B D D%%(()(dll ( *(r   