929af508a579a564074b1d785b03c2d965443475
[vnfsdk/refrepo.git] /
1 /*\r
2  * Copyright (c) 2016, Huawei Technologies Co., Ltd.\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.openo.gso.gui.servicegateway.roa.inf;\r
18 \r
19 import javax.servlet.http.HttpServletRequest;\r
20 import javax.ws.rs.Consumes;\r
21 import javax.ws.rs.DELETE;\r
22 import javax.ws.rs.POST;\r
23 import javax.ws.rs.Path;\r
24 import javax.ws.rs.PathParam;\r
25 import javax.ws.rs.Produces;\r
26 import javax.ws.rs.core.Context;\r
27 import javax.ws.rs.core.Response;\r
28 \r
29 import org.openo.baseservice.remoteservice.exception.ServiceException;\r
30 \r
31 /**\r
32  * API for restful interface.<br/>\r
33  * <p>\r
34  * </p>\r
35  * \r
36  * @author\r
37  * @version GSO 0.5 2016/8/4\r
38  */\r
39 @Path("/servicegateway/v1/services")\r
40 @Consumes({"application/json"})\r
41 @Produces({"application/json"})\r
42 public interface IServiceGatewayRoaModule {\r
43 \r
44     /**\r
45      * Create service instance.<br/>\r
46      * \r
47      * @param servletReq http request\r
48      * @return response\r
49      * @throws ServiceException when operate database or parameter is wrong.\r
50      * @since GSO 0.5\r
51      */\r
52     @POST\r
53     @Produces({"application/json"})\r
54     @Consumes({"application/json"})\r
55     Response createService(@Context HttpServletRequest servletReq) throws ServiceException;\r
56 \r
57     /**\r
58      * Delete service instance.<br/>\r
59      * \r
60      * @param serviceId service instance id\r
61      * @param servletReq http request\r
62      * @return response\r
63      * @throws ServiceException when operate database or parameter is wrong.\r
64      * @since GSO 0.5\r
65      */\r
66     @DELETE\r
67     @Produces({"application/json"})\r
68     @Consumes({"application/json"})\r
69     @Path("/{serviceId}")\r
70     Response deleteService(@PathParam("serviceId") String serviceId, @Context HttpServletRequest servletReq)\r
71             throws ServiceException;\r
72 \r
73 }\r