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