- private Service toService(ServiceRegistrationInfo s) {
- return new Service(s.name(), Duration.ofSeconds(s.keepAliveInterval()));
+ @DeleteMapping("/services")
+ public ResponseEntity<String> deleteService( //
+ @RequestParam(name = "name", required = true) String name) {
+ try {
+ Service service = removeService(name);
+ // Remove the policies from the repo and let the consistency monitoring
+ // do the rest.
+ removePolicies(service);
+ return new ResponseEntity<String>("OK", HttpStatus.NO_CONTENT);
+ } catch (Exception e) {
+ return new ResponseEntity<String>(e.getMessage(), HttpStatus.NO_CONTENT);
+ }