OxygenUtil

public class OxygenUtil
extends Object

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


用於與 Oxygen 服務互動的公用程式。

摘要

公用建構函式

OxygenUtil()

OxygenUtil 的預設建構函式

公用方法

static OxygenClient createOxygenClient(File file)

建立 OxygenClient 的輔助程式。

void downloadLaunchFailureLogs(TargetSetupError error, ITestLogger logger)

當 Oxygen 無法啟動虛擬裝置時,請從 GCS 下載錯誤記錄。

static LogDataType getDefaultLogType(String logFileName)

根據記錄檔名稱判斷記錄檔的記錄資料類型。

static String getRegionFromZoneMeta(String zone)

從指定的區域字串擷取區域。

static String getTargetRegion(TestDeviceOptions deviceOptions)

根據提供的裝置選項,擷取目標區域。

公用建構函式

OxygenUtil

public OxygenUtil ()

OxygenUtil 的預設建構函式

公用方法

createOxygenClient

public static OxygenClient createOxygenClient (File file)

建立 OxygenClient 的輔助程式。

參數
file File:Oxygen 用戶端二進位檔案。

傳回
OxygenClient OxygenClient 類別,用於建立 CF 裝置。

downloadLaunchFailureLogs

public void downloadLaunchFailureLogs (TargetSetupError error, 
                ITestLogger logger)

當 Oxygen 無法啟動虛擬裝置時,請從 GCS 下載錯誤記錄。

參數
error TargetSetupError:透過 Oxygen 服務租用裝置時發生 TargetSetupError。

logger ITestLogger:記錄檔案的 ITestLogger

getDefaultLogType

public static LogDataType getDefaultLogType (String logFileName)

根據記錄檔名稱判斷記錄檔的記錄資料類型。

參數
logFileName String:遠端記錄檔案的名稱。

傳回
LogDataType 記錄檔案連結的 LogDataType。如果無法根據名稱判斷記錄資料類型,則會傳回 UNKNOWN 類型。

getRegionFromZoneMeta

public static String getRegionFromZoneMeta (String zone)

從指定的區域字串擷取區域。

參數
zone String:輸入可用區字串,格式為「projects/12345/zones/us-west12-a」。

傳回
String 擷取的區域字串,例如「us-west12」。

getTargetRegion

public static String getTargetRegion (TestDeviceOptions deviceOptions)

根據提供的裝置選項,擷取目標區域。如果在裝置選項中明確設定目標區域,則會傳回指定的區域。如果未設定目標區域,系統會根據執行個體的區域擷取區域。

參數
deviceOptions TestDeviceOptions:包含裝置選項的 TestDeviceOptions 物件。

傳回
String 目標區域。