GceRemoteCmdFormatter

public class GceRemoteCmdFormatter
extends Object

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


用於格式化指令以存取遠端 GCE 裝置的工具類別。

摘要

公用建構函式

GceRemoteCmdFormatter()

公用方法

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

用於建立 scp 指令的工具,可從遠端 gce 裝置擷取檔案。

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

可根據某些參數,為 gce 裝置建立 SSH 指令的工具。

公用建構函式

GceRemoteCmdFormatter

public GceRemoteCmdFormatter ()

公用方法

getScpCommand

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

用於建立 scp 指令的工具,可從遠端 gce 裝置擷取檔案。

參數
sshKey File:安全殼層金鑰 ERROR(/File)

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

user String

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

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

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

mode GceRemoteCmdFormatter.ScpMode:是否將本機檔案推送至遠端或從遠端拉取

傳回
代表 gce 裝置 scp 指令的清單。

getSshCommand

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

實用工具,可根據某些參數為 gce 裝置建立 SSH 指令。

參數
sshKey File:安全殼層金鑰 ERROR(/File)

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

user String

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

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

傳回
代表 gce 裝置 ssh 指令的清單。