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.vendorlicense.rest;
23 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdcrests.common.RestConstants;
27 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
28 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
29 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
30 import org.springframework.validation.annotation.Validated;
32 import javax.validation.Valid;
33 import javax.validation.constraints.NotNull;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
38 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
41 @Path("/v1.0/vendor-license-models")
42 @Produces(MediaType.APPLICATION_JSON)
43 @Consumes(MediaType.APPLICATION_JSON)
44 @Api(value = "Vendor License Models")
46 public interface VendorLicenseModels {
50 @ApiOperation(value = "List vendor license models",
51 response = VendorLicenseModelEntityDto.class,
52 responseContainer = "List")
53 Response listLicenseModels(@ApiParam(
54 value = "Currently supported value: 'Final' - only vendor License models with final versions "
55 + "will be return - with their latest final version")
56 @QueryParam("versionFilter") String versionFilter,
57 @NotNull(message = USER_MISSING_ERROR_MSG)
58 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
62 @ApiOperation(value = "Create vendor license model")
63 Response createLicenseModel(@Valid VendorLicenseModelRequestDto request,
64 @NotNull(message = USER_MISSING_ERROR_MSG)
65 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
68 @Path("/{vlmId}/versions/{versionId}")
69 @ApiOperation(value = "Update vendor license model")
70 Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request,
71 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
73 @ApiParam(value = "Vendor license model version Id") @PathParam
74 ("versionId") String versionId,
75 @NotNull(message = USER_MISSING_ERROR_MSG)
76 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
79 @Path("/{vlmId}/versions/{versionId}")
80 @ApiOperation(value = "Get vendor license model",
81 response = VendorLicenseModelEntityDto.class)
82 Response getLicenseModel(
83 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
84 @ApiParam(value = "Vendor license model version Id") @PathParam
85 ("versionId") String versionId,
86 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
90 @Path("/{vlmId}/versions/{versionId}")
91 @ApiOperation(value = "Delete vendor license model")
92 Response deleteLicenseModel(
93 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
94 @ApiParam(value = "Vendor license model version Id") @PathParam
95 ("versionId") String versionId,
96 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
100 @Path("/{vlmId}/versions/{versionId}/actions")
101 @ApiOperation(value = "Update vendor license model")
102 Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request,
103 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
105 @ApiParam(value = "Vendor license model version Id") @PathParam
106 ("versionId") String versionId,
107 @NotNull(message = USER_MISSING_ERROR_MSG)
108 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);