5bc9833638d9a6c875c39bde38b17a9f23d40f0d
[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.ResourceDictionary;\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  * ResourceDictionaryRest.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 \r
37 public interface ResourceDictionaryRest {\r
38 \r
39     /**\r
40      * This is a getDataDictionaryByPath rest service\r
41      * \r
42      * @param name\r
43      * @return ResourceDictionary\r
44      * @throws BluePrintException\r
45      */\r
46     @GET\r
47     @Path("/dictionary/{name}")\r
48     @Consumes({MediaType.APPLICATION_JSON})\r
49     @Produces({MediaType.APPLICATION_JSON})\r
50     @ApiOperation(value = "Provides Rest service to get Resource dictionary", response = ResourceDictionary.class)\r
51     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
52             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
53     ResourceDictionary getResourceDictionaryByName(@ApiParam(required = true) @PathParam("name") String name)\r
54             throws BluePrintException;\r
55 \r
56     /**\r
57      * This is a saveDataDictionary rest service\r
58      * \r
59      * @param resourceMapping\r
60      * @return ResourceDictionary\r
61      * @throws BluePrintException\r
62      */\r
63 \r
64     @POST\r
65     @Path("/dictionary")\r
66     @Consumes({MediaType.APPLICATION_JSON})\r
67     @Produces({MediaType.APPLICATION_JSON})\r
68     @ApiOperation(value = "Provides Rest service to Save Resource dictionary Type", response = ResourceDictionary.class)\r
69     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
70             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
71     ResourceDictionary saveResourceDictionary(@ApiParam(required = true) ResourceDictionary resourceMapping)\r
72             throws BluePrintException;\r
73 \r
74     /**\r
75      * This is a deleteDataDictionaryByName rest service\r
76      * \r
77      * @param name\r
78      * @throws BluePrintException\r
79      */\r
80     @DELETE\r
81     @Path("/dictionary/{name}")\r
82     @Consumes({MediaType.APPLICATION_JSON})\r
83     @Produces({MediaType.APPLICATION_JSON})\r
84     @ApiOperation(value = "Provides Rest service to delete ResourceDictionary Type")\r
85     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
86             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
87     void deleteResourceDictionaryByName(@ApiParam(required = true) @PathParam("name") String name)\r
88             throws BluePrintException;\r
89 \r
90     /**\r
91      * This is a searchResourceDictionaryByTags rest service\r
92      * \r
93      * @param tags\r
94      * @return ResourceDictionary\r
95      * @throws BluePrintException\r
96      */\r
97     @GET\r
98     @Path("/dictionarysearch/{tags}")\r
99     @Consumes({MediaType.APPLICATION_JSON})\r
100     @Produces({MediaType.APPLICATION_JSON})\r
101     @ApiOperation(value = "Provides Rest service to search Resource dictionary by tags",\r
102             response = ResourceDictionary.class, responseContainer = "List")\r
103     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
104             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
105     List<ResourceDictionary> searchResourceDictionaryByTags(\r
106             @ApiParam(required = true) @PathParam("tags") String tags) throws BluePrintException;\r
107 \r
108     /**\r
109      * This is a searchResourceDictionaryByNames rest service\r
110      * \r
111      * @param names\r
112      * @return List<ResourceDictionary>\r
113      * @throws BluePrintException\r
114      */\r
115     @POST\r
116     @Path("/dictionarybynames")\r
117     @Consumes({MediaType.APPLICATION_JSON})\r
118     @Produces({MediaType.APPLICATION_JSON})\r
119     @ApiOperation(value = "Provides Rest service to get ResourceDictionary Type by names",\r
120             response = ResourceDictionary.class, responseContainer = "List")\r
121     @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),\r
122             @ApiResponse(code = 500, message = "Unexpected Runtime error")})\r
123     List<ResourceDictionary> searchResourceDictionaryByNames(@ApiParam(required = true) List<String> names)\r
124             throws BluePrintException;\r
125 \r
126 }\r