Skip to content

Commit d9f4b82

Browse files
committed
Added device reset operation to DeviceClient
1 parent 40aa752 commit d9f4b82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/device/device-client.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ export class DeviceClient {
6464
return this.apiClient.releaseDevice(deviceId);
6565
}
6666

67+
/**
68+
* Reset device. If the device is a mobile device, the device cleanup workflow will be started. In case of a desktop device, the
69+
* machine will be rolled back to the latest snapshop, if one exists.
70+
*
71+
* @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview.
72+
*/
73+
public resetDevice(deviceId: DeviceId): Observable<void> {
74+
return this.apiClient.releaseDevice(deviceId);
75+
}
76+
6777
/**
6878
* Redeploy device. The device will be released and redeployed with the same properties as before.
6979
*
@@ -169,6 +179,7 @@ export class DeviceApiClient extends WebmateAPIClient {
169179
private requestDeviceByRequirementsForProjectRoute = new UriTemplate("/projects/${projectId}/device/devices");
170180
private synchronizeDeviceRoute = new UriTemplate("/device/devices/${deviceId}/sync");
171181
private releaseDeviceRoute = new UriTemplate("/device/devices/${deviceId}");
182+
private resetDeviceRoute = new UriTemplate("/device/devices/${deviceId}/reset");
172183
private redeployDeviceRoute = new UriTemplate("/device/devices/${deviceId}/redeploy");
173184

174185
private installAppOnDeviceRoute = new UriTemplate("/device/${deviceId}/appinstall/${packageId}");
@@ -196,6 +207,10 @@ export class DeviceApiClient extends WebmateAPIClient {
196207
return this.sendDELETE(this.releaseDeviceRoute, Map({"deviceId": deviceId}));
197208
}
198209

210+
public resetDevice(deviceId: DeviceId): Observable<void> {
211+
return this.sendPOST(this.resetDeviceRoute, Map({"deviceId": deviceId}));
212+
}
213+
199214
public redeployDevice(deviceId: DeviceId): Observable<void> {
200215
return this.sendPOST(this.redeployDeviceRoute, Map({"deviceId": deviceId}));
201216
}

0 commit comments

Comments
 (0)