예제 #1
0
    def Args(cls, parser):
        """Set up arguments for this command.

    Args:
      parser: An argparse.ArgumentParser.
    """
        scp_utils.BaseScpHelper.Args(parser)

        parser.add_argument('--port', help='The port to connect to.')

        parser.add_argument('--recurse',
                            action='store_true',
                            help='Upload directories recursively.')

        parser.add_argument('--compress',
                            action='store_true',
                            help='Enable compression.')

        parser.add_argument(
            '--scp-flag',
            action='append',
            help='Extra flag to be sent to scp. This flag may be repeated.')

        ssh_utils.AddVerifyInternalIpArg(parser)

        routing_group = parser.add_mutually_exclusive_group()
        routing_group.add_argument('--internal-ip',
                                   default=False,
                                   action='store_true',
                                   help="""\
        Connect to instances using their internal IP addresses rather than their
        external IP addresses. Use this to connect from one instance to another
        on the same VPC network, over a VPN connection, or between two peered
        VPC networks.

        For this connection to work, you must configure your networks and
        firewall to allow SSH connections to the internal IP address of
        the instance to which you want to connect.

        To learn how to use this flag, see
        [](https://cloud.google.com/compute/docs/instances/connecting-advanced#sshbetweeninstances).
        """)

        iap_tunnel.AddSshTunnelArgs(parser, routing_group)
        # TODO(b/190426150): Move this to Beta and then GA.
        if cls.enable_host_based_flags:
            iap_tunnel.AddHostBasedTunnelArgs(parser)
예제 #2
0
  def Args(parser):
    """Set up arguments for this command.

    Args:
      parser: An argparse.ArgumentParser.
    """
    ssh_utils.BaseSSHCLIHelper.Args(parser)
    AddCommandArg(parser)
    AddSSHArgs(parser)
    AddContainerArg(parser)
    flags.AddZoneFlag(
        parser, resource_type='instance', operation_type='connect to')
    ssh_utils.AddVerifyInternalIpArg(parser)

    routing_group = parser.add_mutually_exclusive_group()
    AddInternalIPArg(routing_group)
    iap_tunnel.AddSshTunnelArgs(parser, routing_group)
예제 #3
0
  def Args(cls, parser):
    """Set up arguments for this command.

    Args:
      parser: An argparse.ArgumentParser.
    """
    ssh_utils.BaseSSHCLIHelper.Args(parser)
    AddCommandArg(parser)
    AddSSHArgs(parser)
    AddContainerArg(parser)
    AddTroubleshootArg(parser)
    # TODO(b/190426150): Move this to Beta and then GA.
    if cls.enable_host_based_flags:
      iap_tunnel.AddHostBasedTunnelArgs(parser)

    flags.AddZoneFlag(
        parser, resource_type='instance', operation_type='connect to')
    ssh_utils.AddVerifyInternalIpArg(parser)

    routing_group = parser.add_mutually_exclusive_group()
    AddInternalIPArg(routing_group)
    iap_tunnel.AddSshTunnelArgs(parser, routing_group)