Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Jul 9, 2023
1 parent 519132c commit 9e4ba3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tools/wrench/wrench-daemon/doc/wrench-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
}
},
"/simulation/{simid}/files/{file_id}/size": {
"post": {
"get": {
"tags": [
"WRENCH"
],
Expand Down Expand Up @@ -689,7 +689,7 @@
}
},
"/simulation/{simid}/jobs/{job_name}/tasks": {
"post": {
"get": {
"tags": [
"WRENCH"
],
Expand Down
4 changes: 2 additions & 2 deletions tools/wrench/wrench-daemon/include/routes.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
return res;
});

CROW_ROUTE(app, "/simulation/<string>/files/<string>/size").methods(crow::HTTPMethod::Post)
CROW_ROUTE(app, "/simulation/<string>/files/<string>/size").methods(crow::HTTPMethod::Get)
([this](const crow::request& req, const std::string& simid, const std::string& file_id){
json req_json = json::parse(req.body);
req_json[toStr(simid)] = simid;
Expand All @@ -119,7 +119,7 @@
return res;
});

CROW_ROUTE(app, "/simulation/<string>/jobs/<string>/tasks").methods(crow::HTTPMethod::Post)
CROW_ROUTE(app, "/simulation/<string>/jobs/<string>/tasks").methods(crow::HTTPMethod::Get)
([this](const crow::request& req, const std::string& simid, const std::string& job_name){
json req_json = json::parse(req.body);
req_json[toStr(simid)] = simid;
Expand Down
5 changes: 1 addition & 4 deletions tools/wrench/wrench-daemon/src/SimulationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,7 @@ namespace wrench {
* @return JSON output
*/
json SimulationController::addFile(json data) {
std::cerr << "DATA += " << data << "\n";
auto file = this->workflow->addFile(data["name"], data["size"]);
std::cerr << "ADEDE FILE: " << file->getID() << " with size " << file->getSize() << "\n";
return {};
}

Expand All @@ -733,8 +731,7 @@ namespace wrench {
* @return JSON output
*/
json SimulationController::getFileSize(json data) {
std::cerr << "FILE GET SIZE: " << data << "\n";
auto file = this->workflow->getFileByID(data["name"]);
auto file = this->workflow->getFileByID(data["file_id"]);
json answer;
answer["size"] = file->getSize();
return answer;
Expand Down

0 comments on commit 9e4ba3b

Please sign in to comment.