From a63304affd6cb323fedcf76c2961c9cb983a7597 Mon Sep 17 00:00:00 2001 From: "Tait,Trevor(rt0435)" Date: Tue, 19 Feb 2019 14:54:54 -0500 Subject: ND Context Builder Updates for port/p-interface Issue-ID: LOG-977 Change-Id: I321036e0f51297092b9c88ff668c4e09c89b36a0 Signed-off-by: Tait,Trevor(rt0435) --- config/jolt/p-interfaceSpec.json | 55 ++++++++++++ config/jolt/pserverToVmSpec.json | 47 ++++++++++ config/jolt/sdToModelContextSpec.json | 32 ++++--- config/jolt/sdToNdResourcesSpec.json | 158 ++++++++++++++++++++-------------- 4 files changed, 217 insertions(+), 75 deletions(-) create mode 100644 config/jolt/p-interfaceSpec.json create mode 100644 config/jolt/pserverToVmSpec.json (limited to 'config/jolt') diff --git a/config/jolt/p-interfaceSpec.json b/config/jolt/p-interfaceSpec.json new file mode 100644 index 0000000..c7d5542 --- /dev/null +++ b/config/jolt/p-interfaceSpec.json @@ -0,0 +1,55 @@ +[ + // This section converts the json from network discovery micro-service + // to org.onap.pomba.audit.common.model.Network + + { + "operation": "shift", + "spec": { + "resources": { + "*": { + "id": "uuid", + "name": "name", + "dataQuality": "dataQuality", + "attributeList": { + "*": { + // filter the Network Discovery attributes that we want to keep, to a temporary list: + "name": { + "mac_address": { + "@2": "tempList[]" + }, + "description": { + "@2": "tempList[]" + } + } + } + } + } + } + } + } + , + { + // Convert the attribute names to common model names. + "operation": "shift", + "spec": { + "tempList": { + "*": { + "name": { + "mac_address": { + "#macAddress": "attributeList[#4].name" + }, + "description": { + "#description": "attributeList[#4].name" + } + }, + "*": { + "@": "attributeList[#3].&" + } + } + }, + "*": { + "@": "&" + } + } + } +] diff --git a/config/jolt/pserverToVmSpec.json b/config/jolt/pserverToVmSpec.json new file mode 100644 index 0000000..28896ed --- /dev/null +++ b/config/jolt/pserverToVmSpec.json @@ -0,0 +1,47 @@ +[ + // Use https://jolt-demo.appspot.com/#inception to develop/test + // any changes to this file + { + // This section extracts pservers from generic-vnf from service-decompostion + // and maps them to their associated vservers (VM) + // to org.onap.pomba.common.datatypes.ModelContext + "operation": "shift", + "spec": { + "generic-vnfs": { + "*": { + "pservers": { + "*": { + "pserver-id": "pServer[&1].uuid", + "p-interfaces": { + "p-interface": { + "*": { + "equipment-identifier": "pServer[&4].pInterfaceList[&1].uuid" + } + } + }, + "relationship-list": { + "relationship": { + "*": { + "related-to": { + "vserver": { + "@(2,relationship-data)": { + "*": { + "relationship-key": { + "vserver.vserver-id": { + "@(2,relationship-value)": "pServer[&10].vserver-id" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +] diff --git a/config/jolt/sdToModelContextSpec.json b/config/jolt/sdToModelContextSpec.json index 77a71f1..d9b56c0 100644 --- a/config/jolt/sdToModelContextSpec.json +++ b/config/jolt/sdToModelContextSpec.json @@ -12,11 +12,23 @@ "network-id": "networkList[&1].uuid" } }, + "pnfs": { + "*": { + "pnf-id": "pnfList[&1].uuid", + "p-interfaces": { + "p-interface": { + "*": { + "equipment-identifier": "pnfList[&4].pInterfaceList[&1].uuid" + } + } + } + } + }, "generic-vnfs": { - "*": { + "*": { "vservers": { "*": { - "vserver-id": "vnfList[&3].vfModuleList[0].vmList[&1].uuid" + "vserver-id": "vnfList[&3].vfModuleList[0].vmList[&1].uuid" } }, "l3-networks": { @@ -25,15 +37,15 @@ } }, "vf-modules": { - "vf-module": { - "*": { - "l3-networks" : { - "*": { - "network-id": "vnfList[&6].vfModuleList[0].networkList[&1].uuid" - } + "vf-module": { + "*": { + "l3-networks": { + "*": { + "network-id": "vnfList[&6].vfModuleList[0].networkList[&1].uuid" + } } - } - } + } + } }, "vnfcs": { "*": { diff --git a/config/jolt/sdToNdResourcesSpec.json b/config/jolt/sdToNdResourcesSpec.json index bce2d68..d0031f9 100644 --- a/config/jolt/sdToNdResourcesSpec.json +++ b/config/jolt/sdToNdResourcesSpec.json @@ -1,65 +1,93 @@ -[ - // Use https://jolt-demo.appspot.com/#inception to develop/test - // any changes to this file - { - // This section converts the updated json from service-decomposition - // to org.onap.pomba.contextbuilder.networkdiscovery.model.NdResources - "operation": "shift", - "spec": { - "l3-networks": { - "*": { - "network-id": { - "@": "tempResourceId", - "#l3-network": "tempResourceType" - } - } - }, - "generic-vnfs": { - "*": { - "vservers": { - "*": { - "vserver-id": { - "@": "tempResourceId", - "#vserver": "tempResourceType" - - } - }}, - "vf-modules": { - "vf-module": { - "*": { - "l3-networks": { - "*": { - "network-id": { - "@": "tempResourceId", - "#l3-network": "tempResourceType" - } - } - } - } - } - }, - "l3-networks": { - "*": { - "network-id": { - "@": "tempResourceId", - "#l3-network": "tempResourceType" - } - } - } - } - } - } - }, - { - "operation": "shift", - "spec": { - "tempResourceType": { - "*": { - "@": "ndResources[&].resourceType", - "@(2,tempResourceId[&])": "ndResources[&].resourceId" - } - } - } - } - -] +[ + // Use https://jolt-demo.appspot.com/#inception to develop/test + // any changes to this file + { + // This section converts the updated json from service-decomposition + // to org.onap.pomba.contextbuilder.networkdiscovery.model.NdResources + "operation": "shift", + "spec": { + "l3-networks": { + "*": { + "network-id": { + "@": "tempResourceId", + "#l3-network": "tempResourceType" + } + } + }, + "pnfs": { + "*": { + "p-interfaces": { + "p-interface": { + "*": { + "equipment-identifier": { + "@": "tempResourceId", + "#port": "tempResourceType" + } + } + } + } + } + }, + "generic-vnfs": { + "*": { + "vservers": { + "*": { + "vserver-id": { + "@": "tempResourceId", + "#vserver": "tempResourceType" + } + } + }, + "vf-modules": { + "vf-module": { + "*": { + "l3-networks": { + "*": { + "network-id": { + "@": "tempResourceId", + "#l3-network": "tempResourceType" + } + } + } + } + } + }, + "l3-networks": { + "*": { + "network-id": { + "@": "tempResourceId", + "#l3-network": "tempResourceType" + } + } + }, + "pservers": { + "*": { + "p-interfaces": { + "p-interface": { + "*": { + "equipment-identifier": { + "@": "tempResourceId", + "#port": "tempResourceType" + } + } + } + } + } + } + } + } + } + }, + { + "operation": "shift", + "spec": { + "tempResourceType": { + "*": { + "@": "ndResources[&].resourceType", + "@(2,tempResourceId[&])": "ndResources[&].resourceId" + } + } + } + } + +] -- cgit 1.2.3-korg