imp return full vnfd after onboard of vnfp
package org.openbaton.nfvo.api.catalogue;
+import io.swagger.annotations.ApiOperation;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
-import io.swagger.annotations.ApiOperation;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.List;
-import javax.validation.Valid;
+
import org.openbaton.catalogue.mano.descriptor.VirtualNetworkFunctionDescriptor;
import org.openbaton.catalogue.nfvo.Script;
import org.openbaton.catalogue.nfvo.VNFPackage;
@@ -52,6 +49,12 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.List;
+
+import javax.validation.Valid;
+
@RestController
@RequestMapping("/api/v1/vnf-packages")
@ConfigurationProperties(prefix = "nfvo.marketplace.privateip")
@@ -78,7 +81,7 @@ public class RestVNFPackage {
)
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
- public String onboard(
+ public VirtualNetworkFunctionDescriptor onboard(
@RequestParam("file") MultipartFile file,
@RequestHeader(value = "project-id") String projectId)
throws IOException, VimException, NotFoundException, SQLException, PluginException,
@@ -90,7 +93,8 @@ public class RestVNFPackage {
byte[] bytes = file.getBytes();
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
vnfPackageManagement.onboard(bytes, projectId);
- return "{ \"id\": \"" + virtualNetworkFunctionDescriptor.getVnfPackageLocation() + "\"}";
+// return "{ \"id\": \"" + virtualNetworkFunctionDescriptor.getVnfPackageLocation() + "\"}";
+ return virtualNetworkFunctionDescriptor;
} else throw new IOException("File is empty!");
}
