use of net.ripe.rpki.validator3.api.ApiCommand in project rpki-validator-3 by RIPE-NCC.
the class RoaPrefixAssertionsController method add.
@PostMapping(consumes = { Api.API_MIME_TYPE, "application/json" })
public ResponseEntity<ApiResponse<RoaPrefixAssertionResource>> add(@RequestBody @Valid ApiCommand<AddRoaPrefixAssertion> command) {
final long id = roaPrefixAssertionsService.execute(command.getData());
final RoaPrefixAssertion ignoreFilter = roaPrefixAssertions.get(id);
final Link selfRel = linkTo(methodOn(RoaPrefixAssertionsController.class).get(id)).withSelfRel();
return ResponseEntity.created(URI.create(selfRel.getHref())).body(ApiResponse.data(toResource(ignoreFilter)));
}
use of net.ripe.rpki.validator3.api.ApiCommand in project rpki-validator-3 by RIPE-NCC.
the class TrustAnchorController method add.
@PostMapping(consumes = { Api.API_MIME_TYPE, "application/json" })
public ResponseEntity<ApiResponse<TrustAnchorResource>> add(@RequestBody @Valid ApiCommand<AddTrustAnchor> command, Locale locale) {
long id = trustAnchorService.execute(command.getData());
TrustAnchor trustAnchor = trustAnchorRepository.get(id);
Link selfRel = linkTo(methodOn(TrustAnchorController.class).get(id, locale)).withSelfRel();
return ResponseEntity.created(URI.create(selfRel.getHref())).body(trustAnchorResource(trustAnchor, locale));
}
Aggregations