aboutsummaryrefslogtreecommitdiffstats
path: root/so-simulator
diff options
context:
space:
mode:
Diffstat (limited to 'so-simulator')
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java43
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json3
2 files changed, 15 insertions, 31 deletions
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
index 954ebdd013..d53de914a3 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -35,11 +35,12 @@ public class ProcessVnfc extends AbstractTestAction {
AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
- && context.getVariable("serviceAction").equals("assign")) {
+ && context.getVariable("serviceAction").equals("assign")
+ && context.getVariable("vfModuleName").equals("nc_dummy_id")) {
- AAIResourceUri vnfcURI = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, "zauk51bfrwl09oam001");
+ AAIResourceUri vnfcURI = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, "ssc_server_1");
Vnfc vnfc = new Vnfc();
- vnfc.setVnfcName("zauk51bfrwl09oam001");
+ vnfc.setVnfcName("ssc_server_1");
vnfc.setNfcNamingCode("oamfw");
vnfc.setNfcFunction("EPC-OAM-FIREWALL");
vnfc.setProvStatus("PREPROV");
@@ -51,38 +52,20 @@ public class ProcessVnfc extends AbstractTestAction {
vnfc.setModelVersionId("9e314c37-2258-4572-a399-c0dd7d5f1aec");
vnfc.setModelCustomizationId("2bd95cd4-d7ff-4af0-985d-2adea0339921");
- if (!aaiResourceClient.exists(vnfcURI))
+ if (!aaiResourceClient.exists(vnfcURI)) {
+ logger.debug("creating VNFC");
aaiResourceClient.create(vnfcURI, vnfc);
+
+
+ } else {
+ aaiResourceClient.get(vnfcURI);
+ }
AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE,
context.getVariable("vnfId"), context.getVariable("vfModuleId"));
- AAIResourceUri pserverURI = AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, "test");
- AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER,
- context.getVariable("cloudOwner"), context.getVariable("cloudRegion"),
- context.getVariable("tenant"), "d29f3151-592d-4011-9356-ad047794e236");
- aaiResourceClient.connect(vnfcURI, vserverURI);
- aaiResourceClient.connect(vserverURI, pserverURI);
+ logger.debug("creating VNFC edge to vf module");
aaiResourceClient.connect(vfModuleURI, vnfcURI);
- } else if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
- && context.getVariable("serviceAction").equals("activate")) {
- // For recreate after soft delete
- AAIResourceUri vnfcURI = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, "zauk51bfrwl09oam001");
- AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER,
- context.getVariable("cloudOwner"), context.getVariable("cloudRegion"),
- context.getVariable("tenant"), "d29f3151-592d-4011-9356-ad047794e236");
-
- Relationships relationships = aaiResourceClient.get(vnfcURI).getRelationships().get();
- List<AAIResourceUri> uris = relationships.getRelatedUris(AAIObjectType.VSERVER);
- if (uris.isEmpty() || uris.size() == 0) {
- if (!aaiResourceClient.exists(vserverURI)) {
- AAICommonObjectMapperProvider aaiMapper = new AAICommonObjectMapperProvider();
- InputStream vserverFile =
- new ClassPathResource("openstack/gr_api/CreateVserver.json").getInputStream();
- Vserver vserver = aaiMapper.getMapper().readValue(vserverFile, Vserver.class);
- aaiResourceClient.create(vserverURI, vserver);
- }
- aaiResourceClient.connect(vnfcURI, vserverURI);
- }
}
+
} catch (Exception e) {
logger.debug("Exception in ProcessVnfc.doExecute", e);
}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json
index 725c896b8d..773400e8f6 100644
--- a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json
@@ -24,7 +24,8 @@
],
"physical_network": "sriovnet1",
"pci_slot": "0000:5e:05.6",
- "pci_vendor_info": "8086:154c"
+ "pci_vendor_info": "8086:154c",
+ "host_id": "50197c55fc934e7b3947e17db762f0839320f94983df774d84991ad2"
},
"fixed_ips": [
{