balena-cli
Version:
The official balena Command Line Interface
38 lines (37 loc) • 1.28 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const lazy_1 = require("../../utils/lazy");
const errors_1 = require("../../errors");
class DeviceIdentifyCmd extends core_1.Command {
async run() {
var _a;
const { args: params } = await this.parse(DeviceIdentifyCmd);
const balena = (0, lazy_1.getBalenaSdk)();
try {
await balena.models.device.identify(params.uuid);
}
catch (e) {
if ((_a = e.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('online')) {
throw new errors_1.ExpectedError(`Device ${params.uuid} is not online`);
}
else {
throw e;
}
}
}
}
DeviceIdentifyCmd.description = (0, lazy_1.stripIndent) `
Identify a device.
Identify a device by making the ACT LED blink (Raspberry Pi).
`;
DeviceIdentifyCmd.examples = ['$ balena device identify 23c73a1'];
DeviceIdentifyCmd.args = {
uuid: core_1.Args.string({
description: 'the uuid of the device to identify',
required: true,
}),
};
DeviceIdentifyCmd.authenticated = true;
exports.default = DeviceIdentifyCmd;
//# sourceMappingURL=identify.js.map
;