
                             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  S
SS.r " S S5      r\
R                  \
R                   " \
R"                  R$                  5       " S S\
R&                  5      5       5       rg)z;Command to restart migration jobs for a database migration.    )absolute_import)division)unicode_literals)api_util)migration_jobs)resource_args)base)logzk
        Fetch objects for a Database Migration Service migration job by connection to the source.
        zw        To fetch source objects for a migration job:

          $ {command} MIGRATION_JOB --region=us-central1
        )DESCRIPTIONEXAMPLESc                       \ rS rSrSrS rSrg)_MigrationJobObjectInfo'   z>Container for migration job object data using in list display.c                    UR                   U l         UR                  U l        UR                  b  UR                  OS U l        UR                  U l        UR
                  U l        UR                  U l        UR                  U l	        g )N)
namesourceObjectsource_objecterrorstatephase
createTimecreate_time
updateTimeupdate_time)selfmessages     Elib/surface/database_migration/migration_jobs/fetch_source_objects.py__init__ _MigrationJobObjectInfo.__init__*   sc    DI --D")--";DJDJDJ))D))D    )r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r    r   r   r   '   s
    F*r    r   c                   .    \ rS rSrSr\S 5       rS rSrg)FetchSourceObjects4   zYFetch objects for a Database Migration Service migration job by connection to the source.c                 h    [         R                  " U S5        U R                  R                  S5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
z
to restartz
            table(
              source_object,
              state:label=STATE,
              phase:label=PHASE,
              error:label=ERROR
            )
          N)r   AddOnlyMigrationJobResourceArgsdisplay_info	AddFormat)parsers    r   ArgsFetchSourceObjects.Args9   s-     11&,G
!! # r    c                    UR                   R                  R                  5       n[        R                  " U R                  5       5      nUR                  UR                  5       5      n[        R                  " U R                  5       5      n[        R                  R                  SR                  UR                  UR                  5      5        [        R                   " UUUR"                  SS9  [        R                  R                  SR                  UR                  UR                  5      5        UR%                  U5      nU Vs/ s H  n['        U5      PM     sn$ s  snf )a  Fetch source objects for a Database Migration Service migration job.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  A dict object representing the operations resource describing the restart
  operation if the restart was successful.
z@Waiting for migration job [{}] to fetch source objects with [{}]T)no_resourcez0Fetched source objects for migration job {} [{}])CONCEPTSmigration_jobParser   MigrationJobsClientReleaseTrackr)   RelativeNamer   GetClientInstancer
   statusPrintformatmigrationJobsIdr   	HandleLRO projects_locations_migrationJobsListObjectsr   )r   argsmigration_job_ref	mj_clientresult_operationclientobjos           r   RunFetchSourceObjects.RunK   s$    3399;2243D3D3FGI 33&&( ''(9(9(;<FJJJ	!113C3H3H	I
 //	 JJ:AA--/?/D/D	
 

 1
2C0341#A&444s   E r'   N)	r!   r"   r#   r$   r%   staticmethodr0   rI   r&   r'   r    r   r)   r)   4   s     b "(5r    r)   N)r%   
__future__r   r   r   )googlecloudsdk.api_lib.database_migrationr   r   r   googlecloudsdk.callioper	   googlecloudsdk.corer
   DETAILED_HELPr   DefaultUniverseOnlyReleaseTracksr8   GACommandr)   r'   r    r   <module>rU      s    B &  ' > D C ( #		
* 
* D%%(()=5 =5 * =5r    