@edgeiq/edgeiq-api-js 1.4.7 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/devices/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ interface DevicesInterface extends BaseModelInterface<Device, DeviceInput, Devic
|
|
|
28
28
|
bulkExecuteCommand(ids: string[], command: Command, generateChildCommandExecutions?: boolean): Promise<BulkActionResponse>;
|
|
29
29
|
getFiles(id: string): Promise<EIQFile[]>;
|
|
30
30
|
getCommandExecutions(id: string, filters: CommandExecutionsFilters, pagination: PaginationFilter): Promise<PaginatedCommandExecutions>;
|
|
31
|
+
startRemoteTerminal(id: string, executable?: string): Promise<string>;
|
|
32
|
+
stopRemoteTerminal(id: string): Promise<string>;
|
|
31
33
|
}
|
|
32
34
|
export declare const Devices: DevicesInterface;
|
|
33
35
|
export {};
|
package/dist/devices/index.js
CHANGED
|
@@ -754,5 +754,55 @@ exports.Devices = (function (_super) {
|
|
|
754
754
|
});
|
|
755
755
|
});
|
|
756
756
|
};
|
|
757
|
+
class_1.startRemoteTerminal = function (id, executable) {
|
|
758
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
759
|
+
var axios, error_27;
|
|
760
|
+
return __generator(this, function (_a) {
|
|
761
|
+
switch (_a.label) {
|
|
762
|
+
case 0:
|
|
763
|
+
_a.trys.push([0, 2, , 3]);
|
|
764
|
+
this.logAction("Start remote terminal with device: " + id);
|
|
765
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
766
|
+
return [4, axios.post(constants_1.Endpoints.device + "/" + id + "/start_remote_terminal", {
|
|
767
|
+
executable: executable !== null && executable !== void 0 ? executable : 'sh',
|
|
768
|
+
})];
|
|
769
|
+
case 1:
|
|
770
|
+
_a.sent();
|
|
771
|
+
return [2, "Remote terminal started for device: " + id];
|
|
772
|
+
case 2:
|
|
773
|
+
error_27 = _a.sent();
|
|
774
|
+
if ((0, helpers_1.isApiError)(error_27)) {
|
|
775
|
+
throw error_27;
|
|
776
|
+
}
|
|
777
|
+
throw error_27;
|
|
778
|
+
case 3: return [2];
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
});
|
|
782
|
+
};
|
|
783
|
+
class_1.stopRemoteTerminal = function (id) {
|
|
784
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
785
|
+
var axios, error_28;
|
|
786
|
+
return __generator(this, function (_a) {
|
|
787
|
+
switch (_a.label) {
|
|
788
|
+
case 0:
|
|
789
|
+
_a.trys.push([0, 2, , 3]);
|
|
790
|
+
this.logAction("Stops remote terminal with device: " + id);
|
|
791
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
792
|
+
return [4, axios.post(constants_1.Endpoints.device + "/" + id + "/stop_remote_terminal")];
|
|
793
|
+
case 1:
|
|
794
|
+
_a.sent();
|
|
795
|
+
return [2, "Remote terminal stoped for device: " + id];
|
|
796
|
+
case 2:
|
|
797
|
+
error_28 = _a.sent();
|
|
798
|
+
if ((0, helpers_1.isApiError)(error_28)) {
|
|
799
|
+
throw error_28;
|
|
800
|
+
}
|
|
801
|
+
throw error_28;
|
|
802
|
+
case 3: return [2];
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
});
|
|
806
|
+
};
|
|
757
807
|
return class_1;
|
|
758
808
|
}(ModelClass_1.BaseModelClass));
|