2 * Copyright © 2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openecomp.sdcrests.item.rest;
18 import io.swagger.annotations.Api;
19 import io.swagger.annotations.ApiOperation;
20 import io.swagger.annotations.ApiParam;
21 import org.openecomp.sdcrests.item.types.ItemActionRequestDto;
22 import org.springframework.validation.annotation.Validated;
24 import javax.validation.constraints.NotNull;
26 import javax.ws.rs.core.MediaType;
27 import javax.ws.rs.core.Response;
29 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
30 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
33 @Produces(MediaType.APPLICATION_JSON)
34 @Consumes(MediaType.APPLICATION_JSON)
37 public interface Items {
41 @ApiOperation(value = "Get list of items according to desired filters",
42 responseContainer = "List")
43 Response list(@ApiParam(value = "Filter by item status", allowableValues = "ACTIVE,ARCHIVED")
44 @QueryParam("itemStatus") String itemStatusFilter,
45 @ApiParam(value = "Filter by version status" , allowableValues = "Certified,Draft")
46 @QueryParam("versionStatus") String versionStatusFilter,
47 @ApiParam(value = "Filter by item type" , allowableValues = "vsp,vlm")
48 @QueryParam("itemType") String itemTypeFilter,
49 @ApiParam(value = "Filter by user permission" , allowableValues = "Owner,Contributor")
50 @QueryParam("permission") String permissionFilter,
51 @ApiParam(value = "Filter by onboarding method" , allowableValues = "NetworkPackage,Manual")
52 @QueryParam("onboardingMethod") String onboardingMethodFilter,
53 @NotNull(message = USER_MISSING_ERROR_MSG)
54 @HeaderParam(USER_ID_HEADER_PARAM) String user);
58 @ApiOperation(value = "Get details of a item")
59 Response getItem(@PathParam("itemId") String itemId,
60 @NotNull(message = USER_MISSING_ERROR_MSG)
61 @HeaderParam(USER_ID_HEADER_PARAM) String user);
64 @Path("/{itemId}/actions")
65 @ApiOperation(value = "Acts on item version")
66 Response actOn(ItemActionRequestDto request,
67 @PathParam("itemId") String itemId,
68 @NotNull(message = USER_MISSING_ERROR_MSG)
69 @HeaderParam(USER_ID_HEADER_PARAM) String user);