diff options
author | 2017-09-08 13:27:46 -0400 | |
---|---|---|
committer | 2017-09-08 13:32:24 -0400 | |
commit | 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 (patch) | |
tree | 68c0c53c9156f5aa3c6b3599ac940770f986633d /mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java | |
parent | fa1a211d28a912892fcd888569df033900eb01ee (diff) |
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 <amartell@research.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java index 0b595855df..868828ba60 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java @@ -27,27 +27,35 @@ import org.openecomp.mso.apihandlerinfra.vnfbeans.VnfTypes; import org.openecomp.mso.db.catalog.CatalogDatabase; import org.openecomp.mso.db.catalog.beans.VnfResource; import org.openecomp.mso.logger.MsoLogger; +import org.openecomp.mso.requestsdb.RequestsDatabase; import org.openecomp.mso.utils.UUIDChecker; import org.apache.http.HttpStatus; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; + import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; + import java.io.StringWriter; import java.util.List; @Path(Constants.VNF_TYPES_PATH) +@Api(value="/{version: v1|v2|v3}/vnf-types",description="API Requests of vnfTypes") public class VnfTypesHandler { private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH); @GET - public Response getVnfTypes (@QueryParam("vnf-role") String vnfRole) { + @ApiOperation(value="Finds Vnf Types",response=Response.class) + public Response getVnfTypes (@QueryParam("vnf-role") String vnfRole, @PathParam("version") String version) { long startTime = System.currentTimeMillis (); MsoLogger.setServiceName ("GetVnfTypes"); @@ -56,7 +64,7 @@ public class VnfTypesHandler { msoLogger.debug ("Incoming request received for getVnfTypes with vnf-role:" + vnfRole); List <VnfResource> vnfResources = null; - try(CatalogDatabase db = new CatalogDatabase ()) { + try(CatalogDatabase db = CatalogDatabase.getInstance()) { if (vnfRole != null) { vnfResources = db.getVnfResourcesByRole (vnfRole); } else { @@ -80,9 +88,8 @@ public class VnfTypesHandler { for (int i = 0; i < vnfResources.size (); i++) { VnfType vnfType = beansObjectFactory.createVnfType (); VnfResource vr = vnfResources.get (i); - vnfType.setType (vr.getVnfType ()); vnfType.setDescription (vr.getDescription ()); - vnfType.setId (String.valueOf (vr.getId ())); + vnfType.setId (String.valueOf (vr.getModelUuid())); vnfTypes.getVnfType ().add (vnfType); } |