File: //usr/lib/google-cloud-sdk/lib/surface/compute/__pycache__/ssh.cpython-312.pyc
�
��{S � � � d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlZddlm Z ddl
mZ ddlm
Z
dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! dZ"dZ#ddd�Z$dZ%d� Z&d� Z'd� Z(d � Z)d!� Z*d"e+d#e+d$e+d%e+d&e+d'e,d(e+fd)�Z-d*� Z. d1d+�Z/ej` ejb ejH jd � G d,� d-ejf � � � Z4ej` ejb ejH jj ejH jl � G d.� d/e4� � � Z7d0� Z8 e8� e7_9 e8� e4_9 y)2z3Implements the command for SSHing into an instance.� )�absolute_import)�division)�unicode_literalsN)�base_classes)�base)�
completers)�flags)�
iap_tunnel)�network_troubleshooter)�scope)� ssh_utils)�user_permission_troubleshooter)�vm_boot_troubleshooter)�vm_status_troubleshooter)�vpc_troubleshooter)�
containers)�ssh)�log)�
properties)�retryz�
Recommendation: To check for possible causes of SSH connectivity issues and get
recommendations, rerun the ssh command with the --troubleshoot option.
{0}
z1
Or, to investigate an IAP tunneling issue:
{0}
�alpha�beta)r r zK
Starting ssh troubleshooting for instance {0} in zone {1}
Start time: {2}
c �* � | j dd�� y )Nz --commandzt A command to run on the virtual machine.
Runs the command on the target instance and then exits.
��help��add_argument��parsers �lib/surface/compute/ssh.py�
AddCommandArgr! D s � �����
� � � c � � | j ddd�� | j dt j dd�� | j d t j d
d�� y
)z>Additional flags and positional args to be passed to *ssh(1)*.z
--ssh-flag�appendaA Additional flags to be passed to *ssh(1)*. It is recommended that flags
be passed using an assignment operator and quotes. Example:
$ {command} example-instance --zone=us-central1-a --ssh-flag="-vvv" --ssh-flag="-L 80:localhost:80"
This flag will replace occurences of ``%USER%'', ``%INSTANCE%'', and
``%INTERNAL%'' with their dereferenced values. For example, passing
``80:%INSTANCE%:80'' into the flag is equivalent to passing
``80:162.222.181.197:80'' to *ssh(1)* if the external IP address of
'example-instance' is 162.222.181.197.
If connecting to the instance's external IP, then ``%INSTANCE%'' is
replaced with that, otherwise it is replaced with the internal IP.
``%INTERNAL%'' is always replaced with the internal interface of the
instance.
��actionr � user_hostz[USER@]INSTANCEa8 Specifies the instance to SSH into.
``USER'' specifies the username with which to SSH. If omitted,
the user login name is used. If using OS Login, USER will be replaced
by the OS Login user.
``INSTANCE'' specifies the name of the virtual machine instance to SSH
into.
)� completer�metavarr �ssh_argszW Flags and positionals passed to the underlying ssh implementation.
z\ $ {command} example-instance --zone=us-central1-a -- -vvv -L 80:%INSTANCE%:80
)�nargsr �exampleN)r r �InstancesCompleter�argparse� REMAINDERr s r �
AddSSHArgsr0 N st � �����
�
� � �* �����-�-��
� �
� ��������
�
� r"