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 static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
24 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26 import io.swagger.annotations.Api;
27 import io.swagger.annotations.ApiOperation;
28 import io.swagger.annotations.ApiParam;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
31 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
32 import org.springframework.validation.annotation.Validated;
34 import javax.validation.Valid;
35 import javax.validation.constraints.NotNull;
36 import javax.validation.constraints.Pattern;
37 import javax.ws.rs.Consumes;
38 import javax.ws.rs.DELETE;
39 import javax.ws.rs.GET;
40 import javax.ws.rs.HeaderParam;
41 import javax.ws.rs.POST;
42 import javax.ws.rs.PUT;
43 import javax.ws.rs.Path;
44 import javax.ws.rs.PathParam;
45 import javax.ws.rs.Produces;
46 import javax.ws.rs.QueryParam;
47 import javax.ws.rs.core.MediaType;
48 import javax.ws.rs.core.Response;
50 @Path("/v1.0/vendor-software-products/{vspId}/networks")
51 @Produces(MediaType.APPLICATION_JSON)
52 @Consumes(MediaType.APPLICATION_JSON)
53 @Api(value = "Vendor Software Product Networks")
55 public interface Networks {
58 @ApiOperation(value = "List vendor software product networks",
59 response = NetworkDto.class,
60 responseContainer = "List")
61 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
62 @Pattern(regexp = Version.VERSION_REGEX,
63 message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
65 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
70 @ApiOperation(value = "Create a vendor software product network")
71 Response create(@Valid NetworkRequestDto request,
72 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
73 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
78 @ApiOperation(value = "Get vendor software product network",
79 response = NetworkDto.class)
80 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
81 @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
83 @Pattern(regexp = Version.VERSION_REGEX,
84 message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
86 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
91 @ApiOperation(value = "Delete vendor software product network")
92 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
93 @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
95 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
100 @ApiOperation(value = "Update vendor software product network")
101 Response update(@Valid NetworkRequestDto request,
102 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
103 @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
105 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)