Publish swagger files for SDC APIs
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / externaltesting-rest / externaltesting-rest-services / src / main / java / org / openecomp / sdcrests / externaltesting / rest / ExternalTesting.java
1 /*
2  * Copyright © 2019 iconectiv
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.sdcrests.externaltesting.rest;
18
19 import io.swagger.v3.oas.annotations.info.Info;
20 import io.swagger.v3.oas.annotations.tags.Tag;
21 import io.swagger.v3.oas.annotations.tags.Tags;
22 import java.util.List;
23 import javax.ws.rs.Consumes;
24 import javax.ws.rs.GET;
25 import javax.ws.rs.POST;
26 import javax.ws.rs.PUT;
27 import javax.ws.rs.Path;
28 import javax.ws.rs.PathParam;
29 import javax.ws.rs.Produces;
30 import javax.ws.rs.QueryParam;
31 import javax.ws.rs.core.MediaType;
32 import javax.ws.rs.core.Response;
33 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
34 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
35 import org.openecomp.core.externaltesting.api.ClientConfiguration;
36 import org.openecomp.core.externaltesting.api.RemoteTestingEndpointDefinition;
37 import org.springframework.validation.annotation.Validated;
38
39 @Path("/v1.0/externaltesting")
40 @Produces(MediaType.APPLICATION_JSON)
41 @Consumes(MediaType.APPLICATION_JSON)
42 @Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "External-Testing")})
43 @Validated
44
45 public interface ExternalTesting {
46
47     @GET
48     @Path("/config")
49     Response getConfig();
50
51     @PUT
52     @Path("/config")
53     Response setConfig(ClientConfiguration config);
54
55     @GET
56     @Path("/testcasetree")
57     Response getTestCasesAsTree();
58
59     @GET
60     @Path("/endpoints")
61     Response getEndpoints();
62
63     @PUT
64     @Path("/endpoints")
65     Response setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
66
67     @GET
68     @Path("/endpoints/{endpointId}/scenarios")
69     Response getScenarios(@PathParam("endpointId") String endpointId);
70
71     @GET
72     @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites")
73     Response getTestsuites(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
74
75     @GET
76     @Path("/endpoints/{endpointId}/scenarios/{scenario}/testcases")
77     Response getTestcases(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario);
78
79     @GET
80     @Path("/endpoints/{endpointId}/scenarios/{scenario}/testsuites/{testsuite}/testcases/{testcase}")
81     Response getTestcase(@PathParam("endpointId") String endpointId, @PathParam("scenario") String scenario,
82             @PathParam("testsuite") String testsuite, @PathParam("testcase") String testcase);
83
84     @POST
85     @Path("/endpoints/{endpointId}/executions/{executionId}")
86     Response getExecution(@PathParam("endpointId") String endpointId, @PathParam("executionId") String executionId);
87
88
89     @POST
90     @Path("/executions")
91     @Consumes(MediaType.MULTIPART_FORM_DATA)
92     Response execute(@QueryParam("vspId") String vspId, @QueryParam("vspVersionId") String vspVersionId,
93             @QueryParam("requestId") String requestId,
94             @Multipart(value = "files", required = false) List<Attachment> files,
95             @Multipart(value = "testdata", required = false) String testData);
96
97     @GET
98     @Path("/executions")
99     Response getValidationResult(@QueryParam("requestId") String requestId,
100             @QueryParam("endPoint") List<String> endPoints);
101 }