+ @ApiOperation(value = "Deletes the policy")
+ @ApiResponses(value = {@ApiResponse(code = 204, message = "Policy deleted")})
+ public Mono<ResponseEntity<Void>> deletePolicy( //
+ @RequestParam(name = "instance", required = true) String id) {
+ Policy policy = policies.get(id);
+ if (policy != null && policy.ric().state().equals(Ric.RicState.IDLE)) {
+ policies.remove(policy);
+ return a1Client.deletePolicy(policy.ric().getConfig().baseUrl(), id) //
+ .flatMap(notUsed -> {
+ return Mono.just(new ResponseEntity<>(HttpStatus.NO_CONTENT));
+ });
+ } else {
+ return Mono.just(new ResponseEntity<>(HttpStatus.NOT_FOUND));
+ }
+ }
+
+ @PutMapping(path = "/policy")
+ @ApiOperation(value = "Create the policy")
+ @ApiResponses(value = {@ApiResponse(code = 201, message = "Policy created")})
+ public Mono<ResponseEntity<String>> putPolicy( //
+ @RequestParam(name = "type", required = true) String typeName, //
+ @RequestParam(name = "instance", required = true) String instanceId, //
+ @RequestParam(name = "ric", required = true) String ricName, //
+ @RequestParam(name = "service", required = true) String service, //
+ @RequestBody String jsonBody) {