[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-software-products-rest / vendor-software-products-rest-services / src / main / java / org / openecomp / sdcrests / vsp / rest / Networks.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.sdcrests.vsp.rest;
22
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;
29
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;
43
44 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
45 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
46
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")
51 @Validated
52 public interface Networks extends VspEntities {
53   @GET
54   @Path("/")
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)
61                     String user);
62
63   @POST
64   @Path("/")
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)
70                       String user);
71
72   @GET
73   @Path("/{networkId}")
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)
81                    String user);
82
83   @DELETE
84   @Path("/{networkId}")
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")
89                       String networkId,
90                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
91                       String user);
92
93   @PUT
94   @Path("/{networkId}")
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")
100                       String networkId,
101                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
102                       String user);
103 }