balena-cli
Version:
The official balena Command Line Interface
43 lines (40 loc) • 1.72 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const lazy_1 = require("../../utils/lazy");
const validation_1 = require("../../utils/validation");
class LeaveCmd extends core_1.Command {
async run() {
const { args: params } = await this.parse(LeaveCmd);
const promote = await Promise.resolve().then(() => require('../../utils/promote'));
const Logger = await Promise.resolve().then(() => require('../../utils/logger'));
const logger = Logger.getLogger();
return promote.leave(logger, params.deviceIpOrHostname);
}
}
LeaveCmd.description = (0, lazy_1.stripIndent) `
Remove a local device from its balena fleet.
Remove a local device from its balena fleet, causing the device to
"leave" the server it is provisioned on. This effectively makes the device
"unmanaged". The device must be running balenaOS.
The device entry on the server is preserved after running this command,
so the device can subsequently re-join the server if needed.
If you don't specify a device hostname or IP, this command will automatically
scan the local network for balenaOS devices and prompt you to select one
from an interactive picker. This may require administrator/root privileges.
`;
LeaveCmd.examples = [
'$ balena leave',
'$ balena leave balena.local',
'$ balena leave 192.168.1.25',
];
LeaveCmd.args = {
deviceIpOrHostname: core_1.Args.string({
description: 'the device IP or hostname',
parse: validation_1.parseAsLocalHostnameOrIp,
}),
};
LeaveCmd.authenticated = true;
LeaveCmd.primary = true;
exports.default = LeaveCmd;
//# sourceMappingURL=index.js.map
;