Skip to content
Snippets Groups Projects
Commit c23ed141 authored by Manuel Spuhler's avatar Manuel Spuhler
Browse files

Return raw response for histogram

parent 19d696a1
No related branches found
No related tags found
No related merge requests found
...@@ -66,11 +66,10 @@ public class MiningApi extends WokenClientController { ...@@ -66,11 +66,10 @@ public class MiningApi extends WokenClientController {
}); });
} }
@ApiOperation(value = "Create an experiment on Exareme", response = String.class) @ApiOperation(value = "Create an histogram on Exareme", response = String.class)
@RequestMapping(value = "/exareme", method = RequestMethod.POST) @RequestMapping(value = "/exareme", method = RequestMethod.POST)
public ResponseEntity runExaremeMining(@RequestBody List<HashMap<String, String>> queryList) { public ResponseEntity runExaremeMining(@RequestBody List<HashMap<String, String>> queryList) {
LOGGER.info("Run an histogram"); LOGGER.info("Run an histogram");
// Mining mining = new Mining();
String query = gson.toJson(queryList); String query = gson.toJson(queryList);
String url = miningExaremeQueryUrl + "/" + "HISTOGRAMS"; String url = miningExaremeQueryUrl + "/" + "HISTOGRAMS";
...@@ -78,12 +77,6 @@ public class MiningApi extends WokenClientController { ...@@ -78,12 +77,6 @@ public class MiningApi extends WokenClientController {
try { try {
StringBuilder results = new StringBuilder(); StringBuilder results = new StringBuilder();
int code = HTTPUtil.sendPost(url, query, results); int code = HTTPUtil.sendPost(url, query, results);
if (code >= 500) {
return new ResponseEntity<>("Internal Server Error", HttpStatus.INTERNAL_SERVER_ERROR);
}
if (code >= 400) {
return new ResponseEntity<>("Bad request", HttpStatus.BAD_REQUEST);
}
return ResponseEntity.ok(gson.toJson(results.toString())); return ResponseEntity.ok(gson.toJson(results.toString()));
} catch (IOException e) { } catch (IOException e) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment