263ac73df5662a2654ae92880ea998c560833eb7
[sdc/sdc-workflow-designer.git] /
1 /**
2  * Copyright 2018 ZTE Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.sdc.workflowdesigner.resources;
18
19 import javax.ws.rs.Consumes;
20 import javax.ws.rs.GET;
21 import javax.ws.rs.Path;
22 import javax.ws.rs.Produces;
23 import javax.ws.rs.core.MediaType;
24 import javax.ws.rs.core.Response;
25 import org.eclipse.jetty.http.HttpStatus;
26 import com.codahale.metrics.annotation.Timed;
27 import io.swagger.annotations.Api;
28 import io.swagger.annotations.ApiOperation;
29 import io.swagger.annotations.ApiResponse;
30 import io.swagger.annotations.ApiResponses;
31
32 @Path("/healthCheck")
33 @Api(tags = {" Health Check "})
34 public class HealthCheckResource {
35
36   @GET
37   @Consumes(MediaType.APPLICATION_JSON)
38   @Produces(MediaType.APPLICATION_JSON)
39   @ApiOperation(value = " Health Check ")
40   @ApiResponses(value = {
41       @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
42           response = String.class),
43       @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
44           message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
45       @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
46           response = String.class)})
47   @Timed
48   public Response queryEmsList() {
49     return Response.ok("hello world !").build();
50   }
51 }