
                         >    S r SSKJr  SSKJr  SSKJr  S rS rS r	g)	zHelpers for compute diagnose.    )	ssh_utils)log)resource_printerc                     U (       d   [         R                  R                  S5        g[         R                  R                  S5        [        R                  " U S5        [         R                  R                  S5        g)z?Prints the list of instances to which the command will work on.zNo instances found.Nz1The command will run for the following instances:ztable(name, zone) )r   outPrintr   )	instancess    Clib/googlecloudsdk/command_lib/compute/diagnose/internal_helpers.pyPrintHeaderr      sK    	GGMM'(
''--CD$78''--    c                 f    [         R                  " U 5      nSR                  U R                  US9nU$ )zReturns a string that identifies the instance.

Args:
  instance: The instance proto.

Returns:
  A string that identifies the zone and the external ip of the instance.
z![{instance_name}] ({instance_ip}))instance_nameinstance_ip)r   GetExternalIPAddressformatselfLink)instanceexternal_ipresults      r   GetInstanceNetworkTitleStringr   "   s<     ..x8+.55%% 6 & 
-r   c                 V    UR                  U R                  SS9nUR                  5       $ )Nzcompute.zones)
collection)ParsezoneName)r   resource_registryzone_refs      r   GetZoneFromInstancer   3   s'    $$X]]$O(	r   N)
__doc__"googlecloudsdk.command_lib.computer   googlecloudsdk.corer   googlecloudsdk.core.resourcer   r   r   r    r   r   <module>r%      s$    $ 9 # 9"r   