ravendb
Version:
RavenDB client for Node.js
45 lines • 1.36 kB
JavaScript
import { RavenCommand } from "../../Http/RavenCommand.js";
import { RaftIdGenerator } from "../../Utility/RaftIdGenerator.js";
export class AddNodeToOrchestratorTopologyOperation {
_databaseName;
_node;
constructor(databaseName, node) {
this._databaseName = databaseName;
this._node = node;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new AddNodeToOrchestratorTopologyCommand(this._databaseName, this._node);
}
}
class AddNodeToOrchestratorTopologyCommand extends RavenCommand {
_databaseName;
_node;
constructor(databaseName, node) {
super();
this._databaseName = databaseName;
this._node = node;
}
createRequest(node) {
let uri = node.url + "/admin/databases/orchestrator?name=" + this._urlEncode(this._databaseName);
if (this._node) {
uri += "&node=" + this._urlEncode(this._node);
}
return {
uri,
method: "PUT"
};
}
async setResponseAsync(bodyStream, fromCache) {
return this._parseResponseDefaultAsync(bodyStream);
}
get isReadRequest() {
return false;
}
getRaftUniqueRequestId() {
return RaftIdGenerator.newId();
}
}
//# sourceMappingURL=AddNodeToOrchestratorTopologyOperation.js.map