[DMAAP-BC] Consolidate bus controller repos
[dmaap/buscontroller.git] / dmaap-bc / src / main / java / org / onap / dmaap / dbcapi / resources / InfoResource.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.dmaap
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 //
22 // $Id$
23
24 package org.onap.dmaap.dbcapi.resources;
25
26
27
28 import io.swagger.annotations.Api;
29 import io.swagger.annotations.ApiOperation;
30 import io.swagger.annotations.ApiResponse;
31 import io.swagger.annotations.ApiResponses;
32
33 import javax.ws.rs.Consumes;
34 import javax.ws.rs.GET;
35 import javax.ws.rs.Path;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.core.Context;
38 import javax.ws.rs.core.MediaType;
39 import javax.ws.rs.core.Response;
40 import javax.ws.rs.core.UriInfo;
41
42 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
43 import org.onap.dmaap.dbcapi.model.ApiError;
44 import org.onap.dmaap.dbcapi.model.Dmaap;
45
46
47
48 @Path("/info")
49 @Api( value= "info", description = "Endpoint for this instance of DBCL.  Returns health info." )
50 @Consumes(MediaType.APPLICATION_JSON)
51 @Produces(MediaType.APPLICATION_JSON)
52 @Authorization
53 public class InfoResource extends BaseLoggingClass {
54
55
56         private ResponseBuilder responseBuilder = new ResponseBuilder();
57         
58         @GET
59         @ApiOperation( value = "return info details", notes = "returns the `info` object", response = Dmaap.class)
60     @ApiResponses( value = {
61         @ApiResponse( code = 200, message = "Success", response = Dmaap.class),
62         @ApiResponse( code = 400, message = "Error", response = ApiError.class )
63     })
64
65         public Response getInfo(@Context UriInfo uriInfo)  {
66                 return responseBuilder.success(204, null);
67         }
68         
69
70         
71         
72 }