Package com.cloudtestapi.device
Class DeviceClient
- java.lang.Object
-
- com.cloudtestapi.common.AbstractClient
-
- com.cloudtestapi.device.DeviceClient
-
public class DeviceClient extends AbstractClient
-
-
Field Summary
-
Fields inherited from class com.cloudtestapi.common.AbstractClient
gson, HTTP_RSP_OK
-
-
Constructor Summary
Constructors Constructor Description DeviceClient(Credential credential)DeviceClient(Credential credential, ClientProfile clientProfile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetDevicesResponsegetDevicesByCloudId(int cloudId)Get device list by cloud idDeviceBasicInfogetDeviceState(Integer deviceId, Integer cloudId)Get device statusModelList[]getModelList(String projectId)Get device model listProjectModelList[]getProjectModelList(String projectId, Constants.ModelListFilterType filterType, Integer offset, Integer limit)Get device model list configured in web controller<T extends ModelListInfoBase>
T[]getProjectModelListInfo(Integer listId, Constants.ModelListFilterType filterType)get model group infovoidrebootDevice(ReportDeviceOfflineRequest request)Reboot devicevoidreportDeviceOffline(ReportDeviceOfflineRequest request)上报设备掉线voidsetWdbPath(String path)voidsoftRebootDevice(SoftRebootDeviceRequest request)Soft-reboot deviceStringwdbConnect(String address, String token, int timeOut)-
Methods inherited from class com.cloudtestapi.common.AbstractClient
getClientProfile, getCredential, getLogger, internalRequest, setClientProfile, setCredential, setLogger, setProfile
-
-
-
-
Constructor Detail
-
DeviceClient
public DeviceClient(Credential credential)
-
DeviceClient
public DeviceClient(Credential credential, ClientProfile clientProfile)
-
-
Method Detail
-
getDevicesByCloudId
public GetDevicesResponse getDevicesByCloudId(int cloudId) throws CloudTestSDKException
Get device list by cloud id- Parameters:
cloudId- int- Returns:
- GetDevicesResponse
- Throws:
CloudTestSDKException- CloudTestSDKException
-
getDeviceState
public DeviceBasicInfo getDeviceState(Integer deviceId, Integer cloudId) throws CloudTestSDKException
Get device status- Parameters:
deviceId- IntegercloudId- Integer- Returns:
- DeviceBasicInfo
- Throws:
CloudTestSDKException- CloudTestSDKException
-
reportDeviceOffline
public void reportDeviceOffline(ReportDeviceOfflineRequest request) throws CloudTestSDKException
上报设备掉线- Parameters:
request- ReportDeviceOfflineRequest- Throws:
CloudTestSDKException- CloudTestSDKException
-
rebootDevice
public void rebootDevice(ReportDeviceOfflineRequest request) throws CloudTestSDKException
Reboot device- Parameters:
request- ReportDeviceOfflineRequest- Throws:
CloudTestSDKException- CloudTestSDKException
-
softRebootDevice
public void softRebootDevice(SoftRebootDeviceRequest request) throws CloudTestSDKException
Soft-reboot device- Parameters:
request- SoftRebootDeviceRequest- Throws:
CloudTestSDKException- CloudTestSDKException
-
getModelList
public ModelList[] getModelList(String projectId) throws CloudTestSDKException
Get device model list- Returns:
- ModelList device model list
- Throws:
CloudTestSDKException- CloudTestSDKException
-
getProjectModelList
public ProjectModelList[] getProjectModelList(String projectId, Constants.ModelListFilterType filterType, Integer offset, Integer limit) throws CloudTestSDKException
Get device model list configured in web controller- Parameters:
projectId-offset- start from 1limit-filterType- group by model or group by device,return all groups if filterType is null- Returns:
- Throws:
CloudTestSDKException
-
getProjectModelListInfo
public <T extends ModelListInfoBase> T[] getProjectModelListInfo(Integer listId, Constants.ModelListFilterType filterType) throws CloudTestSDKException
get model group info- Type Parameters:
T- result type, sub-class of ModelListInfoBase- Parameters:
listId- id of the model groupfilterType- type of the model group, refer com.cloudtestapi.common.Constants.ModelListFilterType- Returns:
- list of ModelListInfo when filterType is MODEL list of DeviceListInfo when filterType is DEVICE
- Throws:
CloudTestSDKException
-
wdbConnect
public String wdbConnect(String address, String token, int timeOut) throws IOException, InterruptedException, CloudTestSDKException
-
setWdbPath
public void setWdbPath(String path)
-
-