From 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 Mon Sep 17 00:00:00 2001 From: Arthur Martella Date: Fri, 8 Sep 2017 13:27:46 -0400 Subject: 1710 Rebase - Second Attempt This commit rebases changes from openecomp-mso/internal-staging-1710 up to and including this codecloud commit: 54483fc6606ddb1591a2e9da61bff8712325f924 Wed Sep 6 18:12:56 2017 -0400 Rebasing was done on a branch on top of this commit in so/master in ONAP: 93fbdfbe46104f8859d4754040f979cb7997c157 Thu Sep 7 16:42:59 2017 +0000 Change-Id: I4ad9abf40da32bf5bdca43e868b8fa2dbcd9dc59 Issue-id: SO-107 Signed-off-by: Arthur Martella --- .../mso/apihandlerinfra/VfModuleModelNamesHandler.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java index 07d70e9982..aee6c8f2c1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java @@ -26,21 +26,24 @@ import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import org.apache.http.HttpStatus; - import org.openecomp.mso.apihandlerinfra.vnfbeans.VfModuleModelName; import org.openecomp.mso.apihandlerinfra.vnfbeans.VfModuleModelNames; import org.openecomp.mso.apihandlerinfra.vnfbeans.ObjectFactory; import org.openecomp.mso.db.catalog.CatalogDatabase; import org.openecomp.mso.db.catalog.beans.VfModule; import org.openecomp.mso.logger.MsoLogger; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; @Path(Constants.VF_MODULE_MODEL_NAMES_PATH) +@Api(value="/{version: v2|v3}/vf-module-model-names",description="API Requests to find Vf Module model names") public class VfModuleModelNamesHandler { private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH); @@ -48,13 +51,14 @@ public class VfModuleModelNamesHandler { private static final String LOG_REPLY_NAME = "MSO-APIH:InfrastructurePortal."; @GET - public Response getVfModuleModelNames () { + @ApiOperation(value="Finds Vf Module Model Names",response=Response.class) + public Response getVfModuleModelNames (@PathParam("version") String version) { long startTime = System.currentTimeMillis (); String methodName = "getVfModuleModelNames"; MsoLogger.setServiceName (LOG_SERVICE_NAME + methodName); msoLogger.debug ("Incoming request received for vfModuleModelNames"); List vfModules = null; - try (CatalogDatabase db = new CatalogDatabase()){ + try (CatalogDatabase db = CatalogDatabase.getInstance()){ vfModules = db.getAllVfModules (); } catch (Exception e) { msoLogger.debug ("No connection to catalog DB", e); @@ -79,7 +83,7 @@ public class VfModuleModelNamesHandler { vfModuleModelName.setModelInvariantUuid (vm.getModelInvariantUuid ()); vfModuleModelName.setIsBase(vm.isBase()); vfModuleModelName.setDescription (vm.getDescription ()); - vfModuleModelName.setId (String.valueOf (vm.getId ())); + vfModuleModelName.setId (String.valueOf (vm.getModelUUID())); vfModuleModelName.setAsdcServiceModelVersion(vm.getVersion ()); vfModuleModelNames.getVfModuleModelName ().add (vfModuleModelName); } -- cgit 1.2.3-korg