import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@ApiResponse(code = 200, message = "OK", response = ServiceStatus.class, responseContainer = "List"), //
@ApiResponse(code = 404, message = "Service is not found", response = String.class)})
public ResponseEntity<String> getServices(//
+ @ApiParam(name = "name", required = false, value = "The name of the service") //
@RequestParam(name = "name", required = false) String name) {
-
if (name != null && this.services.get(name) == null) {
return new ResponseEntity<>("Service not found", HttpStatus.NOT_FOUND);
}
@ApiResponse(code = 404, message = "Service not found", response = String.class)})
@DeleteMapping("/services")
public ResponseEntity<String> deleteService(//
+ @ApiParam(name = "name", required = true, value = "The name of the service") //
@RequestParam(name = "name", required = true) String serviceName) {
try {
Service service = removeService(serviceName);
@ApiResponse(code = 404, message = "The service is not found, needs re-registration")})
@PutMapping("/services/keepalive")
public ResponseEntity<String> keepAliveService(//
+ @ApiParam(name = "name", required = true, value = "The name of the service") //
@RequestParam(name = "name", required = true) String serviceName) {
try {
services.getService(serviceName).keepAlive();