2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdcrests.vsp.rest;
23 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
27 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
28 import org.springframework.validation.annotation.Validated;
30 import javax.validation.Valid;
31 import javax.validation.constraints.NotNull;
32 import javax.ws.rs.Consumes;
33 import javax.ws.rs.DELETE;
34 import javax.ws.rs.GET;
35 import javax.ws.rs.HeaderParam;
36 import javax.ws.rs.POST;
37 import javax.ws.rs.PUT;
38 import javax.ws.rs.Path;
39 import javax.ws.rs.PathParam;
40 import javax.ws.rs.Produces;
41 import javax.ws.rs.core.MediaType;
42 import javax.ws.rs.core.Response;
44 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
45 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
47 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/networks")
48 @Produces(MediaType.APPLICATION_JSON)
49 @Consumes(MediaType.APPLICATION_JSON)
50 @Api(value = "Vendor Software Product Networks")
52 public interface Networks extends VspEntities {
55 @ApiOperation(value = "List vendor software product networks",
56 response = NetworkDto.class,
57 responseContainer = "List")
58 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
59 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
60 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
65 @ApiOperation(value = "Create a vendor software product network")
66 Response create(@Valid NetworkRequestDto request,
67 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
68 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
69 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
74 @ApiOperation(value = "Get vendor software product network",
75 response = NetworkDto.class)
76 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
77 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
78 @ApiParam(value = "Vendor software product network Id")
79 @PathParam("networkId") String networkId,
80 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
85 @ApiOperation(value = "Delete vendor software product network")
86 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
87 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
88 @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
90 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
95 @ApiOperation(value = "Update vendor software product network")
96 Response update(@Valid NetworkRequestDto request,
97 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
98 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
99 @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
101 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)