
                             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                  R                  5       " S S	\R                  5      5       rg
)z<Implementation of gcloud dataflow jobs export-steps command.    )apis)
step_graph)	step_json)base)	job_utils)logc                   4    \ rS rSrSr\S 5       rS rS rSr	g)ExportSteps   zwExports information about the steps for the given job.

The only currently supported format is to a GraphViz dot file.
c                 0    [         R                  " U 5        g)zfRegister flags for this command.

Args:
  parser: argparse.ArgumentParser to register arguments with.
N)r   ArgsForJobRef)parsers    )lib/surface/dataflow/jobs/export_steps.pyArgsExportSteps.Args"   s     F#    c           	      *   [         R                  " U5      n[        R                  " [        R
                  R                  UR                  UR                  UR                  [        R
                  R                  R                  R                  S95      $ )zRuns the command.

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

Returns:
  An iterator over the steps in the given job.
)
project_id	region_idview)r   ExtractJobRefr   ExtractStepsr   JobsGetjobId	projectIdlocationGET_REQUESTViewValueValuesEnumJOB_VIEW_ALL)selfargsjob_refs      r   RunExportSteps.Run+   sq     %%d+G!!		MM((&&&&::GG	 	 	IJ Jr   c                     U(       a]  [         R                  " US5       HA  n[        R                  R	                  U5        [        R                  R	                  S5        MC     gg)zThis method is called to print the result of the Run() method.

Args:
  args: all the arguments that were provided to this command invocation.
  steps: The step information returned from Run().
	StepGraph
N)r   YieldGraphvizr   outwrite)r!   r"   stepslines       r   DisplayExportSteps.Display<   sC     **5+>$dd ? r    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r$   r.   __static_attributes__r0   r   r   r
   r
      s&    
 $ $J"
r   r
   N)r5   googlecloudsdk.api_lib.dataflowr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataflowr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHABETACommandr
   r0   r   r   <module>rA      sd     C 1 6 5 ( 9 # D%%++T->->-C-CD*$,, * E*r   