f887d8f63e573a19a3ba7f58478c6d110a92f43e
[sdnc/apps.git] /
1 /*
2  * ============LICENSE_START===================================================
3  * Copyright (c) 2018 Amdocs
4  * ============================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=====================================================
17  */
18 package org.onap.sdnc.apps.pomba.servicedecomposition.service.rs;
19
20 import io.swagger.annotations.Api;
21 import io.swagger.annotations.ApiOperation;
22 import io.swagger.annotations.ApiParam;
23 import io.swagger.annotations.ApiResponse;
24 import io.swagger.annotations.ApiResponses;
25 import io.swagger.annotations.Authorization;
26 import javax.servlet.http.HttpServletRequest;
27 import javax.ws.rs.GET;
28 import javax.ws.rs.HeaderParam;
29 import javax.ws.rs.Path;
30 import javax.ws.rs.Produces;
31 import javax.ws.rs.QueryParam;
32 import javax.ws.rs.core.Context;
33 import javax.ws.rs.core.HttpHeaders;
34 import javax.ws.rs.core.MediaType;
35 import javax.ws.rs.core.Response;
36 import org.onap.logging.ref.slf4j.ONAPLogConstants;
37
38 @Api(authorizations = @Authorization("basicAuth"))
39 @Path("/service")
40 @Produces(MediaType.APPLICATION_JSON)
41 public interface RestService {
42
43     public static final String SERVICE_NAME = "service-decomposition";
44
45     @GET
46     @Path("/context")
47     @Produces(MediaType.APPLICATION_JSON)
48     @ApiOperation(
49             value = "Fetch network info for service",
50             notes = "Returns a A&AI JSON object augmented with related entities"
51     )
52     @ApiResponses(
53             value = {
54                     @ApiResponse(code = 200, message = "OK"),
55                     @ApiResponse(code = 400, message = "Bad Request"),
56                     @ApiResponse(code = 404, message = "Service not available"),
57                     @ApiResponse(code = 500, message = "Unexpected Runtime error")
58                     })
59     public Response getContext(
60             @Context HttpServletRequest request,
61             @HeaderParam(HttpHeaders.AUTHORIZATION) @ApiParam(hidden=true) String authorization,
62             @HeaderParam(ONAPLogConstants.Headers.PARTNER_NAME) @ApiParam(required=true) String xFromAppId,
63             @HeaderParam(ONAPLogConstants.Headers.REQUEST_ID) String xTransactionId,
64             @QueryParam("serviceInstanceId") @ApiParam(required=true) String serviceInstanceId);
65 }