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.action.rest;
23 import com.sun.jersey.multipart.FormDataParam;
24 import io.swagger.annotations.Api;
25 import io.swagger.annotations.ApiOperation;
26 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
27 import org.springframework.validation.annotation.Validated;
29 import java.io.InputStream;
30 import javax.servlet.http.HttpServletRequest;
31 import javax.ws.rs.Consumes;
32 import javax.ws.rs.HeaderParam;
33 import javax.ws.rs.POST;
34 import javax.ws.rs.PUT;
35 import javax.ws.rs.Path;
36 import javax.ws.rs.PathParam;
37 import javax.ws.rs.Produces;
38 import javax.ws.rs.core.Context;
39 import javax.ws.rs.core.MediaType;
40 import javax.ws.rs.core.Response;
43 @Path("/workflow/v1.0/actions")
44 @Produces(MediaType.APPLICATION_JSON)
45 @Consumes(MediaType.APPLICATION_JSON)
46 @Api(value = "Actions")
48 public interface ActionsForSwaggerFileUpload {
51 * Upload an artifact to an action.
53 * @param actionInvariantUuId Invariant UuId of the action to which the artifact is uploaded
54 * @param artifactName Name of the artifact
55 * @param artifactLabel Label of the artifact
56 * @param artifactCategory Category of the artifact
57 * @param artifactDescription Description of the artifact
58 * @param artifactProtection Artifact protection mode
59 * @param checksum Checksum of the artifact
60 * @param artifactToUpload Artifact content object
61 * @param servletRequest Servlet request object
62 * @return Generated UuId of the uploaded artifact
65 @Path("/{actionInvariantUuId}/artifacts")
66 @ApiOperation(value = "Upload new Artifact")
67 @Consumes(MediaType.MULTIPART_FORM_DATA)
68 Response uploadArtifact(@PathParam("actionInvariantUuId") String actionInvariantUuId,
69 @Multipart(value = "artifactName", required = false) String artifactName,
70 @Multipart(value = "artifactLabel", required = false)
72 @Multipart(value = "artifactCategory", required = false)
73 String artifactCategory,
74 @Multipart(value = "artifactDescription", required = false)
75 String artifactDescription,
76 @Multipart(value = "artifactProtection", required = false)
77 String artifactProtection,
78 @HeaderParam("Content-MD5") String checksum,
79 @FormDataParam(value = "uploadArtifact") InputStream artifactToUpload,
80 @Context HttpServletRequest servletRequest);
84 @Path("/{actionInvariantUuId}/artifacts/{artifactUuId}")
85 @ApiOperation(value = "Update an existing artifact")
86 @Consumes(MediaType.MULTIPART_FORM_DATA)
87 Response updateArtifact(@PathParam("actionInvariantUuId") String actionInvariantUuId,
88 @PathParam("artifactUuId") String artifactUuId,
89 @Multipart(value = "artifactName", required = false) String artifactName,
90 @Multipart(value = "artifactLabel", required = false)
92 @Multipart(value = "artifactCategory", required = false)
93 String artifactCategory,
94 @Multipart(value = "artifactDescription", required = false)
95 String artifactDescription,
96 @Multipart(value = "artifactProtection", required = false)
97 String artifactProtection,
98 @HeaderParam("Content-MD5") String checksum,
99 @FormDataParam(value = "updateArtifact") InputStream artifactToUpdate,
100 @Context HttpServletRequest servletRequest);