weaviate-client
Version:
JS/TS client for Weaviate
33 lines (32 loc) • 787 B
JavaScript
import { CommandBase } from '../validation/commandBase.js';
export default class NodesStatusGetter extends CommandBase {
className;
output;
constructor(client) {
super(client);
}
withClassName = (className) => {
this.className = className;
return this;
};
withOutput = (output) => {
this.output = output;
return this;
};
validate() {
// nothing to validate
}
do = () => {
let path = '/nodes';
if (this.className) {
path = `${path}/${this.className}`;
}
if (this.output) {
path = `${path}?output=${this.output}`;
}
else {
path = `${path}?output=verbose`;
}
return this.client.get(path);
};
}