302b2bd97a85538cb026afcb33a2d3a2b95c5f52
[vnfsdk/refrepo.git] /
1 /*
2  * Copyright (c) 2016, Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openo.gso.gui.servicegateway.roa.inf;
18
19 import javax.servlet.http.HttpServletRequest;
20 import javax.ws.rs.Consumes;
21 import javax.ws.rs.DELETE;
22 import javax.ws.rs.POST;
23 import javax.ws.rs.Path;
24 import javax.ws.rs.PathParam;
25 import javax.ws.rs.Produces;
26 import javax.ws.rs.core.Context;
27 import javax.ws.rs.core.Response;
28
29 import org.openo.baseservice.remoteservice.exception.ServiceException;
30
31 /**
32  * API for restful interface.<br/>
33  * <p>
34  * </p>
35  * 
36  * @author
37  * @version GSO 0.5 2016/8/4
38  */
39 @Path("/servicegateway/v1/services")
40 @Consumes({"application/json"})
41 @Produces({"application/json"})
42 public interface IServiceGatewayRoaModule {
43
44     /**
45      * Create service instance.<br/>
46      * 
47      * @param servletReq http request
48      * @return response
49      * @throws ServiceException when operate database or parameter is wrong.
50      * @since GSO 0.5
51      */
52     @POST
53     @Produces({"application/json"})
54     @Consumes({"application/json"})
55     Response createService(@Context HttpServletRequest servletReq) throws ServiceException;
56
57     /**
58      * Delete service instance.<br/>
59      * 
60      * @param serviceId service instance id
61      * @param servletReq http request
62      * @return response
63      * @throws ServiceException when operate database or parameter is wrong.
64      * @since GSO 0.5
65      */
66     @DELETE
67     @Produces({"application/json"})
68     @Consumes({"application/json"})
69     @Path("/{serviceId}")
70     Response deleteService(@PathParam("serviceId") String serviceId, @Context HttpServletRequest servletReq)
71             throws ServiceException;
72
73 }