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.sdc.vendorsoftwareproduct.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.io.InputStream;
47 import java.lang.reflect.InvocationTargetException;
49 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
50 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
52 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
53 @Produces(MediaType.APPLICATION_JSON)
54 @Consumes(MediaType.APPLICATION_JSON)
55 @Api(value = "Orchestration Template Candidate")
57 public interface OrchestrationTemplateCandidate extends VspEntities {
61 @Consumes(MediaType.MULTIPART_FORM_DATA)
63 @PathParam("vspId") String vspId,
64 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
65 @Multipart("upload") Attachment fileToUpload,
66 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
70 @Produces(MediaType.APPLICATION_OCTET_STREAM)
71 @ApiOperation(value = "Get uploaded candidate HEAT file",
72 notes = "Downloads in process candidate HEAT file",
73 response = File.class)
75 @PathParam("vspId") String vspId,
76 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
77 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
82 @ApiOperation(value = "process Orchestration Template Candidate",
83 response = UploadFileResponseDto.class)
85 @PathParam("vspId") String vspId,
86 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
87 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
88 throws InvocationTargetException, IllegalAccessException;
92 @ApiOperation(value = "Update an existing vendor software product")
93 Response updateFilesDataStructure(
94 @PathParam("vspId") String vspId,
95 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
96 @Valid FileDataStructureDto fileDataStructureDto,
97 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
102 @ApiOperation(value = "Get uploaded HEAT file files data structure",
103 notes = "Downloads the latest HEAT package",
104 response = FileDataStructureDto.class)
105 Response getFilesDataStructure(
106 @PathParam("vspId") String vspId,
107 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
108 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)