(control) Move export data endpoint to actions controller

This commit is contained in:
Viktor Lofgren 2024-01-15 11:06:22 +01:00
parent c0b15427fe
commit 4665af6c42
2 changed files with 8 additions and 8 deletions

View File

@ -79,6 +79,9 @@ public class ControlNodeActionsService {
Spark.post("/public/nodes/:id/actions/new-crawl-specs", this::createNewSpecsAction,
redirectControl.renderRedirectAcknowledgement("Creating", "../actions?view=new-crawl")
);
Spark.post("/public/nodes/:id/actions/export-data", this::exportData,
redirectControl.renderRedirectAcknowledgement("Exporting", "../storage/exports")
);
}
public Object sideloadEncyclopedia(Request request, Response response) throws Exception {
@ -229,4 +232,9 @@ public class ControlNodeActionsService {
return "";
}
private Object exportData(Request req, Response rsp) {
executorClient.exportData(Context.fromRequest(req), Integer.parseInt(req.params("id")));
return "";
}
}

View File

@ -97,9 +97,6 @@ public class ControlNodeService {
Spark.post("/public/nodes/:id/storage/reset-state/:fid", this::resetState,
redirectControl.renderRedirectAcknowledgement("Restoring", "..")
);
Spark.post("/public/nodes/:id/actions/export-data", this::exportData,
redirectControl.renderRedirectAcknowledgement("Exporting", "../storage/exports")
);
Spark.post("/public/nodes/:id/storage/:fid/export-atags", this::exportAtags,
redirectControl.renderRedirectAcknowledgement("Exporting", "../../storage/exports")
);
@ -112,11 +109,6 @@ public class ControlNodeService {
return "";
}
private Object exportData(Request req, Response rsp) {
executorClient.exportData(Context.fromRequest(req), Integer.parseInt(req.params("id")));
return "";
}
private Object exportAtags(Request req, Response rsp) {
executorClient.exportAtags(Context.fromRequest(req), Integer.parseInt(req.params("id")), req.params("fid"));
return "";