
                         D   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	r\R                  " \R                  R                   \R                  R"                  \R                  R$                  5       " S
 S\R&                  5      5       rSSS.\l        g)zFImplements the command for copying files from and to virtual machines.    )absolute_import)division)unicode_literals)base_classes)base)	scp_utils)logzConsider using the `gcloud compute scp` command instead, which includes support for internal IP connections and Identity-Aware Proxy tunneling.c                   .    \ rS rSrSr\S 5       rS rSrg)	CopyFiles!   zFCopy files to and from Google Compute Engine virtual machines via scp.c                 B    [         R                  R                  U 5        g)zPSet up arguments for this command.

Args:
  parser: An argparse.ArgumentParser.
N)r   BaseScpHelperArgs)parsers    !lib/surface/compute/copy_files.pyr   CopyFiles.Args&   s       (    c                     [         R                  " [        5        [        R                  " U R                  5       5      n[        R                  " 5       nUR                  X!SU R                  5       S9$ )z!See scp_utils.BaseScpCommand.Run.T)	recursiverelease_track)	r	   warningENCOURAGE_SCP_INFOr   ComputeApiHolderReleaseTrackr   r   RunScp)selfargsholder
scp_helpers       r   RunCopyFiles.Run/   s`    KK"#**4+<+<+>?F((*JVT+/+<+<+>  @ @r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r    __static_attributes__r"   r   r   r   r   !   s      O) )@r   r   a<          *{command}* copies files between a virtual machine instance and your
        local machine using the scp command. This command does not work for
        Windows VMs.

        To denote a remote file, prefix the file name with the virtual machine
        instance name (e.g., _example-instance_:~/_FILE_). To denote a local
        file, do not add a prefix to the file name (e.g., ~/_FILE_).

        If a file contains a colon (``:''), you must specify it by either using
        an absolute path or a path that begins with
        ``./''.

        Under the covers, *scp(1)* or pscp (on Windows) is used to facilitate
        the transfer.

        When the destination is local, all sources must be the same virtual
        machine instance. When the destination is remote, all sources must be
        local.
        a            To copy a remote directory '~/REMOTE-DIR' on the instance of
          'example-instance' to '~/LOCAL-DIR' on the local host, run:

            $ {command} example-instance:~/REMOTE-DIR ~/LOCAL-DIR --zone=us-central1-a

          To copy files from your local host to a virtual machine, run:

            $ {command} ~/LOCAL-FILE-1 ~/LOCAL-FILE-2 example-instance:~/REMOTE-DIR --zone=us-central1-a

        )DESCRIPTIONEXAMPLESN)r'   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   googlecloudsdk.corer	   r   ReleaseTracksr   GABETAALPHACommandr   detailed_helpr"   r   r   <module>r7      s     M &  ' 7 ( 8 #  D%%(($*;*;*@*@%%++-@ @-@4	*
	/"	 r   