GceRemoteCmdFormatter

public class GceRemoteCmdFormatter
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.cloud.GceRemoteCmdFormatter


用於將指令格式化為遠端 gce 裝置的公用程式類別。

摘要

巢狀類別

enum GceRemoteCmdFormatter.ScpMode

SCP 可用於推送或提取檔案,視引數的結構而定。 

公用建構函式

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 指令清單。