UNPKG

weaviate-client

Version:
33 lines (32 loc) • 787 B
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); }; }