From 18463785dabe925f7e76f21f28fa7551c7d559e1 Mon Sep 17 00:00:00 2001 From: "Bancala, Ben (bb3476)" Date: Thu, 3 May 2018 11:50:13 -0400 Subject: fixed bug in createvnfinfra bpmn Change-Id: I3e27ec0d1487eb68e8c54d27508b58233bf49808 Issue-ID: SO-602 Signed-off-by: Bancala, Ben (bb3476) --- .../mso/bpmn/infrastructure/aai/AAICreateResources.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java index 93ba0ae5a4..3d05f76b03 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java @@ -24,8 +24,10 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +import org.onap.aai.domain.yang.v12.GenericVnf; import org.openecomp.mso.client.aai.AAIObjectType; import org.openecomp.mso.client.aai.AAIResourcesClient; +import org.openecomp.mso.client.aai.entities.AAIResultWrapper; import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri; import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory; @@ -81,4 +83,16 @@ public class AAICreateResources { aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty()); } + public Optional getVnfInstance(String vnfId){ + try{ + AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId); + AAIResourcesClient aaiRC = new AAIResourcesClient(); + AAIResultWrapper aaiResponse = aaiRC.get(vnfURI); + Optional vnf = aaiResponse.asBean(GenericVnf.class); + return vnf; + } catch (Exception ex){ + return Optional.empty(); + } + } + } -- cgit 1.2.3-korg