@c8y/toolkit
Version:
Toolkit for Cumulocity applications, allows to e.g. deploy an application to an instance of Cumulocity.
29 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerDeleteTenantsCommand = registerDeleteTenantsCommand;
const constants_1 = require("../constants");
const helpers_1 = require("../utils/helpers");
const delete_tenants_1 = require("../utils/delete-tenants");
function registerDeleteTenantsCommand(program) {
program
.command('delete-tenants')
.description('Deletes existing subtenants.')
.requiredOption('-u, --url <URL>', constants_1.OPTIONS_CONSTANTS['TXT.URL'], (0, helpers_1.getFromEnvVar)('C8Y_URL'))
.requiredOption('-U, --user <user>', constants_1.OPTIONS_CONSTANTS['TXT.USERNAME'], (0, helpers_1.getFromEnvVar)('C8Y_USER'))
.requiredOption('-P, --password <password>', constants_1.OPTIONS_CONSTANTS['TXT.PASSWORD'], (0, helpers_1.getFromEnvVar)('C8Y_PASSWORD'))
.option('-t, --tenant <tenant>', constants_1.OPTIONS_CONSTANTS['TXT.TENANT'], (0, helpers_1.getFromEnvVar)('C8Y_TENANT'))
.option('-a, --age <age>', "The age of the tenant in hours since it's creation time", parseInt)
.requiredOption('--companyName <value>', 'A scope is added as the company name. All tenants where the company name includes the provided string, will be deleted.', 'e2eTesting tenant')
.option('--includeChildren', 'If set, all subtenants will be deleted as well')
.action(async (options) => {
try {
await (0, delete_tenants_1.deleteTenants)(options);
}
catch (e) {
console.error('Failed to delete tenants');
console.error(e);
throw e;
}
});
}
//# sourceMappingURL=delete-tenants.js.map