86c89bf90abd8e61cb805147cc29399673eded1d
[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.core.data.ServiceTemplate;\r
22 import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModel;\r
23 import org.springframework.web.bind.annotation.RequestMapping;\r
24 import org.springframework.web.bind.annotation.RequestMethod;\r
25 import org.springframework.web.bind.annotation.ResponseBody;\r
26 \r
27 import javax.ws.rs.*;\r
28 import javax.ws.rs.core.MediaType;\r
29 import java.util.List;\r
30 \r
31 /**\r
32  * ConfigModelRest.java Purpose: Rest service controller for ConfigModelRest Management\r
33  *\r
34  * @author Brinda Santh\r
35  * @version 1.0\r
36  */\r
37 @Api\r
38 @Path("/service")\r
39 @Produces({MediaType.APPLICATION_JSON})\r
40 public interface ConfigModelRest {\r
41 \r
42     /**\r
43      * This is a getConfigModel rest service\r
44      * \r
45      * @param id\r
46      * @return ConfigModel\r
47      * @throws BluePrintException\r
48      */\r
49     @GET\r
50     @Path("/configmodel/{id}")\r
51     @Consumes({MediaType.APPLICATION_JSON})\r
52     @Produces({MediaType.APPLICATION_JSON})\r
53     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)\r
54     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
55             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
56     @RequestMapping(value = "/configmodel/{id}", method = RequestMethod.GET)\r
57     @ResponseBody ConfigModel getConfigModel(@ApiParam(required = true) @PathParam("id") Long id)\r
58             throws BluePrintException;\r
59     \r
60 \r
61     /**\r
62      * This is a saveConfigModel rest service\r
63      * \r
64      * @param configModel\r
65      * @return ConfigModel\r
66      * @throws BluePrintException\r
67      */\r
68     @POST\r
69     @Path("/configmodel")\r
70     @Consumes({MediaType.APPLICATION_JSON})\r
71     @Produces({MediaType.APPLICATION_JSON})\r
72     @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ServiceTemplate.class)\r
73     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
74             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
75     ConfigModel saveConfigModel(@ApiParam(required = true) ConfigModel configModel)\r
76             throws BluePrintException;\r
77 \r
78     /**\r
79      * This is a deleteConfigModel rest service\r
80      * \r
81      * @param id\r
82      * @throws BluePrintException\r
83      */\r
84     @DELETE\r
85     @Path("/configmodel/{id}")\r
86     @Consumes({MediaType.APPLICATION_JSON})\r
87     @Produces({MediaType.APPLICATION_JSON})\r
88     @ApiOperation(value = "Provides Rest service to delete ConfigModel.")\r
89     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
90             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
91     void deleteConfigModel(@ApiParam(required = true) @PathParam("id") Long id) throws BluePrintException;\r
92 \r
93     /**\r
94      * This is a getInitialConfigModel rest service\r
95      * \r
96      * @param name\r
97      * @return ConfigModel\r
98      * @throws BluePrintException\r
99      */\r
100     @GET\r
101     @Path("/configmodelinitial/{name}")\r
102     @Consumes({MediaType.APPLICATION_JSON})\r
103     @Produces({MediaType.APPLICATION_JSON})\r
104     @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)\r
105     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
106             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
107     ConfigModel getInitialConfigModel(@ApiParam(required = true) @PathParam("name") String name)\r
108             throws BluePrintException;\r
109 \r
110     /**\r
111      * This is a getCloneConfigModel rest service\r
112      * \r
113      * @param id\r
114      * @return ConfigModel\r
115      * @throws BluePrintException\r
116      */\r
117     @GET\r
118     @Path("/configmodelclone/{id}")\r
119     @Consumes({MediaType.APPLICATION_JSON})\r
120     @Produces({MediaType.APPLICATION_JSON})\r
121     @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)\r
122     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
123             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
124     ConfigModel getCloneConfigModel(@ApiParam(required = true) @PathParam("id") Long id)\r
125             throws BluePrintException;\r
126 \r
127     /**\r
128      * This is a publishConfigModel rest service\r
129      * \r
130      * @param id\r
131      * @return ServiceTemplate\r
132      * @throws BluePrintException\r
133      */\r
134     @GET\r
135     @Path("/configmodelpublish/{id}")\r
136     @Consumes({MediaType.APPLICATION_JSON})\r
137     @Produces({MediaType.APPLICATION_JSON})\r
138     @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ConfigModel.class)\r
139     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
140             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
141     ConfigModel publishConfigModel(@ApiParam(required = true) @PathParam("id") Long id)\r
142             throws BluePrintException;\r
143 \r
144     /**\r
145      * This is a getConfigModelByNameAndVersion rest service\r
146      * \r
147      * @param name\r
148      * @param version\r
149      * @return ConfigModel\r
150      * @throws BluePrintException\r
151      */\r
152     @GET\r
153     @Path("/configmodelbyname/{name}/version/{version}")\r
154     @Consumes({MediaType.APPLICATION_JSON})\r
155     @Produces({MediaType.APPLICATION_JSON})\r
156     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)\r
157     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
158             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
159     ConfigModel getConfigModelByNameAndVersion(@ApiParam(required = true) @PathParam("name") String name,\r
160                                                @ApiParam(required = true) @PathParam("version") String version) throws BluePrintException;\r
161 \r
162     /**\r
163      * This is a searchServiceModels rest service\r
164      * \r
165      * @param tags\r
166      * @return List<ConfigModel>\r
167      * @throws BluePrintException\r
168      */\r
169     @GET\r
170     @Path("/configmodelsearch/{tags}")\r
171     @Consumes({MediaType.APPLICATION_JSON})\r
172     @Produces({MediaType.APPLICATION_JSON})\r
173     @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)\r
174     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
175             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
176     List<ConfigModel> searchConfigModels(@ApiParam(required = true) @PathParam("tags") String tags)\r
177             throws BluePrintException;\r
178 \r
179 }\r