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
9 * http://www.apache.org/licenses/LICENSE-2.0
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=====================================================
18 package org.onap.sdnc.apps.pomba.servicedecomposition.service.rs;
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;
38 @Api(authorizations = @Authorization("basicAuth"))
40 @Produces(MediaType.APPLICATION_JSON)
41 public interface RestService {
43 public static final String SERVICE_NAME = "service-decomposition";
47 @Produces(MediaType.APPLICATION_JSON)
49 value = "Fetch network info for service",
50 notes = "Returns a A&AI JSON object augmented with related entities"
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")
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);