<referencedLibrary type="PYTHON" name="SSHLibrary" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="HTTPUtils" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="JSONUtils" path="testsuite/robot/library/eteutils"/>
-    <referencedLibrary type="PYTHON" name="HttpLibrary" path="testsuite/robot/library"/>
-    <referencedLibrary type="PYTHON" name="HttpLibrary.HTTP" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="StringTemplater" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="OpenstackLibrary" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="TemplatingEngine" path="testsuite/robot/library/eteutils"/>
     <referencedLibrary type="PYTHON" name="KafkaLibrary" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="DateTime" path="testsuite/robot/library"/>
     <referencedLibrary type="PYTHON" name="SocketUtils" path="testsuite/robot/library/eteutils"/>
+    <referencedLibrary type="PYTHON" name="ONAPLibrary.ServiceMapping" path="testsuite/robot/library"/>
     <pythonpath>
         <path location="robot/library"/>
     </pythonpath>
     <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py"/>
     <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/integration_robot_properties.py"/>
     <variableFiles path="../oom/kubernetes/robot/resources/config/eteshare/config/vm_properties.py"/>
-    <variableFiles path="testsuite/robot/assets/service_mappings.py"/>
     <excludedForValidation/>
     <isValidatedFileSizeCheckingEnabled>true</isValidatedFileSizeCheckingEnabled>
     <validatedFileMaxSize>1024</validatedFileMaxSize>
 
+++ /dev/null
-import json
-import os.path
-
-
-'''
-This metadata identifies the folders to be zipped and uploaded to SDC for model distribution for a given VNF
-'''
-GLOBAL_SERVICE_FOLDER_MAPPING = {}
-
-'''
-Map the service to the list of VNFs to be orchestrated
-'''
-GLOBAL_SERVICE_VNF_MAPPING = {}
-
-'''
-Map the service to the list of Generic Neutron Networks to be orchestrated
-'''
-GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING = {}
-
-'''
-Map the service to the list of Deployment Artifacts for Closed Loop Control
-'''
-GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING = {}
-
-'''
-This metadata identifes the preloads that need to be done for a VNF as there may be more than one (vLB)
-"template" maps to the parameters in the preload_paramenters.py
-  - GLOBAL_PRELOAD_PARAMETERS[<testcase>][<template>] -
-    i.e. GLOBAL_PRELOAD_PARAMETERS['Demo'][dnsscaling_preload.template']
-'''
-GLOBAL_SERVICE_TEMPLATE_MAPPING = {}
-
-'''
-Used by the Heatbridge Validate Query to A&AI to locate the vserver name
-'''
-GLOBAL_VALIDATE_NAME_MAPPING = {}
-
-# Create dictionaries for new MAPPING data to join to original MAPPING data
-GLOBAL_SERVICE_FOLDER_MAPPING2 = {}
-GLOBAL_SERVICE_VNF_MAPPING2 = {}
-GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2 = {}
-GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2 = {}
-GLOBAL_SERVICE_TEMPLATE_MAPPING2 = {}
-GLOBAL_VALIDATE_NAME_MAPPING2 = {} 
-
-
-folder=os.path.join('./demo/service_mapping')
-subfolders = [d for d in os.listdir(folder) if os.path.isdir(os.path.join(folder, d))]
-
-for service in subfolders:
-    filepath=os.path.join('./demo/service_mapping', service, 'service_mapping.json')
-    with open(filepath, 'r') as f:
-        service_mappings = json.load(f)
-    for mapping in service_mappings:
-        if mapping == 'GLOBAL_SERVICE_FOLDER_MAPPING':
-           GLOBAL_SERVICE_FOLDER_MAPPING2[service]=service_mappings[mapping][service]
-        if mapping == 'GLOBAL_SERVICE_VNF_MAPPING':
-           GLOBAL_SERVICE_VNF_MAPPING2[service]=service_mappings[mapping][service]
-        if mapping == 'GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING':
-           GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2[service]=service_mappings[mapping][service]
-        if mapping == 'GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING':
-           GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2[service]=service_mappings[mapping][service]
-        if mapping == 'GLOBAL_SERVICE_TEMPLATE_MAPPING':
-        #  service changes for complex vnf
-           #GLOBAL_SERVICE_TEMPLATE_MAPPING2[service]=service_mappings[mapping][service]
-           for vnftype   in service_mappings[mapping]:
-               GLOBAL_SERVICE_TEMPLATE_MAPPING2[vnftype]=service_mappings[mapping][vnftype]
-        if mapping == 'GLOBAL_VALIDATE_NAME_MAPPING':
-        #  service changes for complex vnf
-           #GLOBAL_VALIDATE_NAME_MAPPING2[service]=service_mappings[mapping][service]
-           for vnftype   in service_mappings[mapping]:
-               GLOBAL_VALIDATE_NAME_MAPPING2[vnftype]=service_mappings[mapping][vnftype]
-
-# Merge dictionaries
-GLOBAL_SERVICE_FOLDER_MAPPING =  dict(GLOBAL_SERVICE_FOLDER_MAPPING.items() + GLOBAL_SERVICE_FOLDER_MAPPING2.items())
-GLOBAL_SERVICE_VNF_MAPPING =  dict(GLOBAL_SERVICE_VNF_MAPPING.items() + GLOBAL_SERVICE_VNF_MAPPING2.items())
-GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING =  dict(GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING.items() + GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING2.items())   
-GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING =  dict(GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING.items() + GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING2.items()) 
-GLOBAL_SERVICE_TEMPLATE_MAPPING =  dict(GLOBAL_SERVICE_TEMPLATE_MAPPING.items() + GLOBAL_SERVICE_TEMPLATE_MAPPING2.items()) 
-GLOBAL_VALIDATE_NAME_MAPPING =  dict(GLOBAL_VALIDATE_NAME_MAPPING.items() + GLOBAL_VALIDATE_NAME_MAPPING2.items()) 
 
 Library           ArchiveLibrary
 Library           HEATUtils
 Library           DateTime
+Library           ONAPLibrary.ServiceMapping
 Resource          global_properties.robot
 Resource          browser_setup.robot
 Resource          json_templater.robot
     ${catalog_resources}=   Create Dictionary
     #####  TODO: Support for Multiple resources of one type in a service  ######
     #   The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list
-    #   GLOBAL_SERVICE_VNF_MAPPING  has the logical mapping but it is not the same key as model_zip_path
-    #   ${vnflist}=   Get From Dictionary    ${GLOBAL_SERVICE_VNF_MAPPING}    ${service}
+    #   Get Service Vnf Mapping  has the logical mapping but it is not the same key as model_zip_path
+    #   ${vnflist}=   Get Service Vnf Mapping    alias    ${service}
     #   Save the resource_id in a dictionary keyed by the resource name in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip)
     #   Create the resources but do not immediately add resource
     #   Add Resource to Service in a separate FOR loop
     \    Set To Dictionary    ${resource_types}    ${resource_type_string}    ${loop_catalog_resource_id}   
     \    Append To List    ${catalog_resource_ids}   ${loop_catalog_resource_id}
 
-
-    ${vnflist}=   Get From Dictionary    ${GLOBAL_SERVICE_VNF_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${vnflist}=    Get Service Vnf Mapping    default    ${service}
 
     # Spread the icons on the pallette starting on the left
     ${xoffset}=    Set Variable    ${0}
     ${vf_module}=   Find Element In Array    ${loop_catalog_resource_resp['groups']}    type    org.openecomp.groups.VfModule
     #
     #  do network
-    ${networklist}=   Get From Dictionary    ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING}    ${service}
+    ${networklist}=    Get Service Neutron Mapping    default    ${service}
     ${generic_neutron_net_uuid}=   Get Generic NeutronNet UUID
     :FOR   ${network}   IN   @{networklist}
     \    ${loop_catalog_resource_id}=   Set Variable    ${generic_neutron_net_uuid}
     #
     # do deployment artifacts
     #
-    ${deploymentlist}=   Get From Dictionary    ${GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING}    ${service}
+    ${deploymentlist}=    Get Service Deployment Artifact Mapping    default    ${service}
     :FOR  ${deployment}  IN   @{deploymentlist}
     \    ${loop_catalog_resource_resp}=    Get ASDC Catalog Resource    ${loop_catalog_resource_id}
     \    Setup SDC Catalog Resource Deployment Artifact Properties      ${catalog_service_id}   ${loop_catalog_resource_resp}  ${catalog_resource_unique_name}  ${deployment}
 
 Library     StringTemplater
 Library     OperatingSystem
 Library     UUID
+Library         ONAPLibrary.ServiceMapping
 
 Resource    openstack/keystone_interface.robot
 Resource    openstack/heat_interface.robot
     Should Match Regexp    ${status_string}    ^(201|200)$
     ${reverse_heatbridge}=   Generate Reverse Heatbridge From Stack Info   ${stack_info}
     Set Test Variable   ${REVERSE_HEATBRIDGE}   ${reverse_heatbridge}
-    Run Validation Query    ${stack_info}    ${service}
+    Run Validation Query    ${stack_info}    ${service}    ${vnf_id}
 
 Run Create VNFC
     [Documentation]    Create a VNFC for a vServer
 
 Run Validation Query
     [Documentation]    Run A&AI query to validate the bulk add
-    [Arguments]    ${stack_info}    ${service}
+    [Arguments]    ${stack_info}    ${service}    ${vnf_id}
     Return from Keyword If    '${service}' == ''
-    ${server_name_parameter}=    Get From Dictionary    ${GLOBAL_VALIDATE_NAME_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${payload}=  Run Get Generic VNF by VnfId       ${vnf_id}
+    ${vnf_type}=    Catenate    ${payload.json()[vnf-type]}
+    ${server_name_parameter}=    Get Validate Name Mapping    default    ${service}    ${vnf_type}
     ${vserver_name}=    Get From Dictionary    ${stack_info}   ${server_name_parameter}
     Run Vserver Query   ${vserver_name}
 
     [Documentation]  Run A&A GET and PUT to set prov-status, orchestration status, and ipv4-oam-address
     [Arguments]   ${vnf_id}  ${ipv4_vnf_address}  ${prov_status}=ACTIVE  ${orch_status}=Active
     ${payload}=  Run Get Generic VNF by VnfId   ${vnf_id}
-
+    ${vnf_type}=    Catenate    ${payload.json()[vnf-type]}
     #${payload_json}=    evaluate    json.loads('''${payload}''')    json
-    set to dictionary    ${payload}    prov-status    ${prov_status}
+    set to dictionary    ${payload}    vnf-type    ${prov_status}
     set to dictionary    ${payload}    orchestration-status   ${orch_status}
     set to dictionary    ${payload}    ipv4-oam-address  ${ipv4_vnf_address}
     ${payload_string}=    evaluate    json.dumps(${payload})    json
 
 Library         Collections
 Library      String
 Library      StringTemplater
+Library           ONAPLibrary.ServiceMapping
+
 Resource          global_properties.robot
 Resource          ../resources/json_templater.robot
 Resource        browser_setup.robot
 
-Variables    ../assets/service_mappings.py
 
 *** Variables ***
 ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH}  /operations/VNF-API:preload-vnf-topology-operation
     [Arguments]    ${service_type_uuid}    ${generic_vnf_name}    ${generic_vnf_type}     ${vf_module_name}    ${vf_modules}    ${service}   ${uuid}
     ${base_vf_module_type}=    Catenate
     ${closedloop_vf_module}=    Create Dictionary
-    ${templates}=    Get From Dictionary    ${GLOBAL_SERVICE_TEMPLATE_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${templates}=    Get Service Template Mapping    default    ${service}    ${generic_vnf_type}
     :FOR    ${vf_module}    IN      @{vf_modules}
     \       ${vf_module_type}=    Get From Dictionary    ${vf_module}    name
     #     need to pass in vnf_index if non-zero
 
 Library    HEATUtils
 Library    Collections
 Library    String
+Library           ONAPLibrary.ServiceMapping
+
 Resource          ../openstack/keystone_interface.robot
 Resource          ../openstack/nova_interface.robot
 Resource          ../openstack/heat_interface.robot
     [Return]    ${dnsscaling}
 
 Get DNSScaling Prefix
-    ${mapping}=    Get From Dictionary   ${GLOBAL_SERVICE_TEMPLATE_MAPPING}   vLB
+    Set Directory    default    ./demo/service_mapping
+    ${mapping}=    Get Service Template Mapping    default    vLB    vLB
     :FOR   ${dict}    IN   @{mapping}
     \    Return From Keyword If    '${dict['isBase']}' == 'false'    ${dict['prefix']}
     [Return]   None
 
 Library           Collections
 Library           String
 Library           DateTime
+Library           ONAPLibrary.ServiceMapping
 Resource          ../asdc_interface.robot
 
-Variables       ../../assets/service_mappings.py
-
 *** Variables ***
 ${ASDC_BASE_PATH}    /sdc1
 ${ASDC_DESIGNER_PATH}    /proxy-designer1#/dashboard
 
 Model Distribution For Directory
     [Arguments]    ${service}   ${catalog_service_name}=    ${cds}=
-    ${directory_list}=    Get From Dictionary    ${GLOBAL_SERVICE_FOLDER_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${directory_list}=    Get Service Folder Mapping    default    ${service}
     ${ziplist}=    Create List
     ${uuid}=    Get Current Date
     ${service_name}=    Catenate    ${service}    ${uuid}
 
 Library           Collections
 Library           String
 Library           DateTime
+Library           ONAPLibrary.ServiceMapping
 Resource          ../asdc_interface.robot
 
-Variables       ../../assets/service_mappings.py
-
 *** Variables ***
 ${ASDC_BASE_PATH}    /sdc1
 ${ASDC_DESIGNER_PATH}    /proxy-designer1#/dashboard
 
 Model Distribution For vCPEResCust Directory
     [Arguments]    ${service}   ${catalog_service_name}=    ${cds}=
-    ${directory_list}=    Get From Dictionary    ${GLOBAL_SERVICE_FOLDER_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${directory_list}=    Get Service Folder Mapping    default    ${service}
     ${ziplist}=    Create List
     ${uuid}=    Get Current Date
     ${service_name}=    Catenate    ${service}    ${uuid}
 
 Library                UUID
 Library                Collections
 Library         JSONUtils
+Library         ONAPLibrary.ServiceMapping
 
 
 
     ${service_instance_id}=   Wait Until Keyword Succeeds    300s   5s    Create VID Service Instance    ${customer_name}    ${service_model_type}    ${service}     ${service_name}   ${project_name}   ${owning_entity}
     Set Test Variable   ${SERVICE_INSTANCE_ID}   ${service_instance_id}
     Validate Service Instance    ${service_instance_id}    ${service}      ${customer_name}
-    ${vnflist}=   Get From Dictionary    ${GLOBAL_SERVICE_VNF_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${vnflist}=    Get Service Vnf Mapping    default    ${service}
     ${generic_vnfs}=    Create Dictionary
     ${vnf_name_index}=   Set Variable  0
     ${vf_module_name_list}=    Create List
     \   ${vnf_name}=    Catenate    Ete_${vnf}_${uuid}_${vnf_name_index}
     \   ${vf_module_name}=    Catenate    Vfmodule_Ete_${vnf}_${uuid}_${vnf_name_index}
     \   ${vnf_name_index}=   Evaluate   ${vnf_name_index} + 1
-    \   ${vnf_type}=   Get VNF Type   ${catalog_resources}   ${vnf}
-    \   ${vf_module}=    Get VF Module    ${catalog_resources}   ${vnf}
+    \   ${vnf_type}=   Get VNF Type   ${catalog_resources}   ${vnf}    ${service}
+    \   ${vf_module}=    Get VF Module    ${catalog_resources}   ${vnf}    ${service}
     \   Append To List   ${STACK_NAMES}   ${vf_module_name}
     \   Wait Until Keyword Succeeds    300s   5s    Create VID VNF    ${service_instance_id}    ${vnf_name}    ${product_family}    ${lcp_region}    ${tenant}    ${vnf_type}   ${CUSTOMER_NAME}
     \   ${vf_module_type}   ${closedloop_vf_module}=   Preload Vnf    ${service_instance_id}   ${vnf_name}   ${vnf_type}   ${vf_module_name}    ${vf_module}    ${vnf}    ${uuid}
     ${service_instance_id}=   Wait Until Keyword Succeeds    300s   5s    Create VID Service Instance    ${customer_name}    ${service_model_type}    ${service}     ${service_name}   ${project_name}   ${owning_entity}
     Set Test Variable   ${SERVICE_INSTANCE_ID}   ${service_instance_id}
     Validate Service Instance    ${service_instance_id}    ${service}      ${customer_name}
-    ${vnflist}=   Get From Dictionary    ${GLOBAL_SERVICE_VNF_MAPPING}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${vnflist}=    Get Service Vnf Mapping    default    ${service}
     ${generic_vnfs}=    Create Dictionary
     :FOR   ${vnf}   IN   @{vnflist}
     \   ${vnf_name}=    Catenate    Ete_${vnf}_${uuid}
 
 Get VNF Type
     [Documentation]    To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI
-    [Arguments]   ${resources}   ${vnf}
-    ${cr}=   Get Catalog Resource    ${resources}    ${vnf}
+    [Arguments]   ${resources}   ${vnf}    ${service}
+    ${cr}=   Get Catalog Resource    ${resources}    ${vnf}    ${service}
     ${vnf_type}=   Get From Dictionary   ${cr}   name
     [Return]   ${vnf_type}
 
 Get VF Module
     [Documentation]    To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI
-    [Arguments]   ${resources}   ${vnf}
-    ${cr}=   Get Catalog Resource    ${resources}    ${vnf}
+    [Arguments]   ${resources}   ${vnf}    ${service}
+    ${cr}=   Get Catalog Resource    ${resources}    ${vnf}    ${service}
     ${vf_module}=    Find Element In Array    ${cr['groups']}    type    org.openecomp.groups.VfModule
     [Return]  ${vf_module}
 
 Get Catalog Resource
     [Documentation]    To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI
-    [Arguments]   ${resources}   ${vnf}
+    [Arguments]   ${resources}   ${vnf}    ${service}
 
-    ${base_name}=  Get Name Pattern   ${vnf}
+    ${base_name}=  Get Name Pattern   ${vnf}    ${service}
     ${keys}=    Get Dictionary Keys    ${resources}
 
     :FOR   ${key}   IN    @{keys}
 
 Get Name Pattern
     [Documentation]    To support services with multiple VNFs, we need to dig the vnf type out of the SDC catalog resources to select in the VID UI
-    [Arguments]   ${vnf}
-    ${list}=   Get From Dictionary    ${GLOBAL_SERVICE_TEMPLATE_MAPPING}   ${vnf}
+    [Arguments]   ${vnf}    ${service}
+    Set Directory    default    ./demo/service_mapping
+    ${list}=    Get Service Template Mapping    default    ${service}    ${vnf}
     :FOR    ${dict}   IN   @{list}
     \   ${base_name}=   Get From Dictionary    ${dict}    name_pattern
     \   Return From Keyword If   '${dict['isBase']}' == 'true'   ${base_name}