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