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

Exareme descriptive stats endpoint

parent 18b3248b
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,24 @@ public class MiningApi extends WokenClientController {
} catch (IOException e) {
return new ResponseEntity<>("Not found", HttpStatus.BAD_REQUEST);
}
}
@ApiOperation(value = "Create an descriptive statistic on Exareme", response = String.class)
@RequestMapping(value = "/exareme-stats", method = RequestMethod.POST)
public ResponseEntity runExaremeDescriptiveStats(@RequestBody List<HashMap<String, String>> queryList) {
LOGGER.info("Run descriptive stats");
String query = gson.toJson(queryList);
String url = miningExaremeQueryUrl + "/" + "DESCRIPTIVE_STATS";
try {
StringBuilder results = new StringBuilder();
int code = HTTPUtil.sendPost(url, query, results);
return ResponseEntity.ok(gson.toJson(results.toString()));
} catch (IOException e) {
return new ResponseEntity<>("Not found", HttpStatus.BAD_REQUEST);
}
}
private static String unwrap(Option<String> option) {
......
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