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.apache.cxf.jaxrs.ext.multipart.Attachment;
27 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
28 import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
29 import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
30 import org.springframework.validation.annotation.Validated;
32 import javax.validation.Valid;
33 import javax.validation.constraints.NotNull;
34 import javax.ws.rs.Consumes;
35 import javax.ws.rs.GET;
36 import javax.ws.rs.HeaderParam;
37 import javax.ws.rs.POST;
38 import javax.ws.rs.PUT;
39 import javax.ws.rs.Path;
40 import javax.ws.rs.PathParam;
41 import javax.ws.rs.Produces;
42 import javax.ws.rs.core.MediaType;
43 import javax.ws.rs.core.Response;
45 import java.io.IOException;
46 import java.lang.reflect.InvocationTargetException;
48 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
49 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
51 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
52 @Produces(MediaType.APPLICATION_JSON)
53 @Consumes(MediaType.APPLICATION_JSON)
54 @Api(value = "Orchestration Template Candidate")
56 public interface OrchestrationTemplateCandidate extends VspEntities {
60 @Consumes(MediaType.MULTIPART_FORM_DATA)
62 @PathParam("vspId") String vspId,
63 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
64 @Multipart("upload") Attachment fileToUpload,
65 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
69 @Produces(MediaType.APPLICATION_OCTET_STREAM)
70 @ApiOperation(value = "Get uploaded candidate HEAT file",
71 notes = "Downloads in process candidate HEAT file",
72 response = File.class)
74 @PathParam("vspId") String vspId,
75 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
76 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
81 @ApiOperation(value = "process Orchestration Template Candidate",
82 response = UploadFileResponseDto.class)
84 @PathParam("vspId") String vspId,
85 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
86 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
87 throws InvocationTargetException, IllegalAccessException;
91 @ApiOperation(value = "Update an existing vendor software product")
92 Response updateFilesDataStructure(
93 @PathParam("vspId") String vspId,
94 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
95 @Valid FileDataStructureDto fileDataStructureDto,
96 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
101 @ApiOperation(value = "Get uploaded HEAT file files data structure",
102 notes = "Downloads the latest HEAT package",
103 response = FileDataStructureDto.class)
104 Response getFilesDataStructure(
105 @PathParam("vspId") String vspId,
106 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
107 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)