ravendb
Version:
RavenDB client for Node.js
43 lines • 1.24 kB
JavaScript
import { RavenCommand } from "../../../Http/RavenCommand.js";
export class StartBackupOperation {
_isFullBackup;
_taskId;
constructor(isFullBackup, taskId) {
this._isFullBackup = isFullBackup;
this._taskId = taskId;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new StartBackupCommand(this._isFullBackup, this._taskId);
}
}
class StartBackupCommand extends RavenCommand {
_isFullBackup;
_taskId;
constructor(isFullBackup, taskId) {
super();
this._isFullBackup = isFullBackup;
this._taskId = taskId;
}
get isReadRequest() {
return true;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database
+ "/admin/backup/database?isFullBackup=" + (this._isFullBackup ? "true" : "false")
+ "&taskId=" + this._taskId;
return {
uri,
method: "POST"
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
}
//# sourceMappingURL=StartBackupOperation.js.map