couchbase-index-manager
Version:
Manage Couchbase indexes during the CI/CD process
28 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResizeIndexMutation = void 0;
const tslib_1 = require("tslib");
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
const index_mutation_1 = require("./index-mutation");
/**
* Represents an index mutation which resizes an existing index to a different number of replicas
*/
class ResizeIndexMutation extends index_mutation_1.IndexMutation {
constructor(definition, name) {
super(definition, name);
}
/** @inheritDoc */
print(logger) {
const color = chalk_1.default.cyanBright;
logger.info(color(`Resize: ${this.displayName}`));
logger.info(color(` Repl: ${this.definition.num_replica}`));
if (this.definition.nodes) {
logger.info(color(` Nodes: ${this.definition.nodes.join()}`));
}
}
async execute(manager) {
await manager.resizeIndex(this.name, this.scope, this.collection, this.definition.num_replica, this.definition.nodes);
}
}
exports.ResizeIndexMutation = ResizeIndexMutation;
//# sourceMappingURL=resize-index-mutation.js.map