aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
index 3bd522ff..2b06fe8f 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
@@ -1,5 +1,6 @@
/**
* Copyright 2018 Huawei Technologies Co., Ltd.
+ * Copyright 2020 Nokia.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,8 +88,9 @@ public class VTPExecutionResource extends VTPResource{
private static final String PRODUCT_ARG="--product";
private static final String OPEN_CLI="open-cli";
private static final String FORMAT="--format";
+ private static final Gson gson = new Gson();
- private static Gson gson = new Gson();
+ protected static String pathToExecutions = "/opt/vtp/data/executions/";
public VTPTestExecutionList executeHandler(VTPTestExecutionList executions, String requestId) throws VTPException {
if (requestId == null) {
@@ -295,8 +297,13 @@ public class VTPExecutionResource extends VTPResource{
if (n.get(END_TIME) != null)
exec.setEndTime(n.get(END_TIME).getAsString());
- if (n.get(EXECUTION_ID) != null)
+ if (n.get(EXECUTION_ID) != null) {
exec.setExecutionId(n.get(EXECUTION_ID).getAsString());
+ exec.setResults(
+ new VTPExecutionResultsSupplier(pathToExecutions)
+ .getExecutionOutputsFromFile(exec.getExecutionId())
+ );
+ }
if (n.get(REQUEST_ID) != null)
exec.setRequestId(n.get(REQUEST_ID).getAsString());
@@ -316,6 +323,7 @@ public class VTPExecutionResource extends VTPResource{
if (n.get(STATUS) != null)
exec.setStatus(n.get(STATUS).getAsString());
+
list.getExecutions().add(exec);
}
@@ -325,6 +333,7 @@ public class VTPExecutionResource extends VTPResource{
return list;
}
+
@Path("/executions")
@GET
@ApiOperation(tags = "VTP Execution", value = " List test executions", response = VTPTestExecution.class, responseContainer = "List")