GceRemoteCmdFormatter

public class GceRemoteCmdFormatter
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.GceRemoteCmdFormatter


公用程式類別,用於格式化指令,以連線至遠端 GCE 裝置。

摘要

公用建構函式

GceRemoteCmdFormatter()

公用方法

static List<String> getScpCommand(File sshKey, List<String> extraOptions, String user, String hostName, String remoteFile, String localFile, GceRemoteCmdFormatter.ScpMode mode)

公用程式,用於建立 scp 指令,從遠端 GCE 裝置擷取檔案。

static List<String> getSshCommand(File sshKey, List<String> extraOptions, String user, String hostName, String... command)

根據某些參數,為 GCE 裝置建立 ssh 指令的公用程式。

公用建構函式

GceRemoteCmdFormatter

public GceRemoteCmdFormatter ()

公用方法

getScpCommand

public static List<String> getScpCommand (File sshKey, 
                List<String> extraOptions, 
                String user, 
                String hostName, 
                String remoteFile, 
                String localFile, 
                GceRemoteCmdFormatter.ScpMode mode)

公用程式,可建立 scp 指令,從遠端 GCE 裝置擷取檔案。

參數
sshKey File:安全殼層金鑰 File

extraOptions List:可新增的 String 清單,用於額外的 SSH 選項。可為空值。

user String

hostName String:要連線至 GCE 裝置的主機名稱。

remoteFile String:要在遠端 GCE 裝置上擷取的檔案。

localFile String:要放置遠端檔案的本機檔案。

mode GceRemoteCmdFormatter.ScpMode:我們是否要將本機檔案推送至遠端,或是從遠端提取檔案

傳回
List<String> 代表 GCE 裝置 scp 指令的清單。

getSshCommand

public static List<String> getSshCommand (File sshKey, 
                List<String> extraOptions, 
                String user, 
                String hostName, 
                String... command)

根據某些參數,為 GCE 裝置建立 ssh 指令的公用程式。

參數
sshKey File:安全殼層金鑰 File

extraOptions List:可新增的 String 清單,用於額外的 SSH 選項。可為空值。

user String

hostName String:要連線至 GCE 裝置的主機名稱。

command String:要在 GCE 裝置上執行的實際指令。

傳回
List<String> 代表 GCE 裝置的 SSH 指令清單。