balena-cli
Version:
The official balena Command Line Interface
43 lines (41 loc) • 1.51 kB
JavaScript
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const cf = require("../../utils/common-flags");
const lazy_1 = require("../../utils/lazy");
const validation_1 = require("../../utils/validation");
class SSHKeyRmCmd extends core_1.Command {
async run() {
var _b;
const { args: params, flags: options } = await this.parse(_a);
const patterns = await Promise.resolve().then(() => require('../../utils/patterns'));
await patterns.confirm((_b = options.yes) !== null && _b !== void 0 ? _b : false, `Are you sure you want to delete key ${params.id}?`);
await (0, lazy_1.getBalenaSdk)().models.key.remove(params.id);
}
}
_a = SSHKeyRmCmd;
SSHKeyRmCmd.aliases = ['key rm'];
SSHKeyRmCmd.deprecateAliases = true;
SSHKeyRmCmd.description = (0, lazy_1.stripIndent) `
Remove an SSH key from balenaCloud.
Remove a single SSH key registered in balenaCloud for the logged in user.
The --yes option may be used to avoid interactive confirmation.
`;
SSHKeyRmCmd.examples = [
'$ balena ssh-key rm 17',
'$ balena ssh-key rm 17 --yes',
];
SSHKeyRmCmd.args = {
id: core_1.Args.integer({
description: 'balenaCloud ID for the SSH key',
parse: async (x) => (0, validation_1.parseAsInteger)(x, 'id'),
required: true,
}),
};
SSHKeyRmCmd.flags = {
yes: cf.yes,
};
SSHKeyRmCmd.authenticated = true;
exports.default = SSHKeyRmCmd;
//# sourceMappingURL=rm.js.map
;