59b73030941a45d4565431740befab8bb7eb1490
[ccsdk/cds.git] /
1 /*\r
2  * Copyright © 2017-2018 AT&T Intellectual Property.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 package org.onap.ccsdk.apps.controllerblueprints.service.rs;\r
18 \r
19 import io.swagger.annotations.*;\r
20 import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
21 import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;\r
22 \r
23 import javax.ws.rs.*;\r
24 import javax.ws.rs.core.MediaType;\r
25 import java.util.List;\r
26 \r
27 /**\r
28  * ModelTypeRest.java Purpose: Rest service controller for Artifact Handling\r
29  *\r
30  * @author Brinda Santh\r
31  * @version 1.0\r
32  */\r
33 @Api\r
34 @Path("/service")\r
35 @Produces({MediaType.APPLICATION_JSON})\r
36 public interface ModelTypeRest {\r
37 \r
38     /**\r
39      * This is a getModelTypeByName rest service\r
40      * \r
41      * @param name\r
42      * @return ModelType\r
43      * @throws BluePrintException\r
44      */\r
45     @GET\r
46     @Path("/modeltype/{name}")\r
47     @Consumes({MediaType.APPLICATION_JSON})\r
48     @Produces({MediaType.APPLICATION_JSON})\r
49     @ApiOperation(value = "Provides Rest service to get Model Type by id", response = ModelType.class)\r
50     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
51             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
52     ModelType getModelTypeByName(@ApiParam(required = true) @PathParam("name") String name)\r
53             throws BluePrintException;\r
54 \r
55     /**\r
56      * This is a saveModelType rest service\r
57      * \r
58      * @param modelType\r
59      * @return ModelType\r
60      * @throws BluePrintException\r
61      */\r
62 \r
63     @POST\r
64     @Path("/modeltype")\r
65     @Consumes({MediaType.APPLICATION_JSON})\r
66     @Produces({MediaType.APPLICATION_JSON})\r
67     @ApiOperation(value = "Provides Rest service to Save Model Type", response = ModelType.class)\r
68     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
69             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
70     ModelType saveModelType(@ApiParam(required = true) ModelType modelType) throws BluePrintException;\r
71 \r
72     /**\r
73      * This is a deleteModelType rest service\r
74      * \r
75      * @param name\r
76      * @throws BluePrintException\r
77      */\r
78     @DELETE\r
79     @Path("/modeltype/{name}")\r
80     @Consumes({MediaType.APPLICATION_JSON})\r
81     @Produces({MediaType.APPLICATION_JSON})\r
82     @ApiOperation(value = "Provides Rest service to delete Model Type")\r
83     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
84             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
85     void deleteModelTypeByName(@ApiParam(required = true) @PathParam("name") String name)\r
86             throws BluePrintException;\r
87 \r
88     /**\r
89      * This is a searchModelType rest service\r
90      * \r
91      * @param tags\r
92      * @return List<ModelType>\r
93      * @throws BluePrintException\r
94      */\r
95     @GET\r
96     @Path("/modeltypesearch/{tags}")\r
97     @Consumes({MediaType.APPLICATION_JSON})\r
98     @Produces({MediaType.APPLICATION_JSON})\r
99     @ApiOperation(value = "Provides Rest service to get Model Type by tags", response = ModelType.class,\r
100             responseContainer = "List")\r
101     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
102             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
103     List<ModelType> searchModelTypes(@ApiParam(required = true) @PathParam("tags") String tags)\r
104             throws BluePrintException;\r
105 \r
106     /**\r
107      * This is a getModelTypeByDefinitionType rest service\r
108      * \r
109      * @param definitionType\r
110      * @return List<ModelType>\r
111      * @throws BluePrintException\r
112      */\r
113     @GET\r
114     @Path("/modeltypebydefinition/{definitionType}")\r
115     @Consumes({MediaType.APPLICATION_JSON})\r
116     @Produces({MediaType.APPLICATION_JSON})\r
117     @ApiOperation(value = "Provides Rest service to get Model Type by tags", response = ModelType.class,\r
118             responseContainer = "List")\r
119     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
120             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
121     List<ModelType> getModelTypeByDefinitionType(\r
122             @ApiParam(required = true) @PathParam("definitionType") String definitionType)\r
123             throws BluePrintException;\r
124 \r
125 }\r