Uploaded image for project: 'Service Design and Creation'
  1. Service Design and Creation
  2. SDC-3254

Map topology inputs to properties in substitution mapping

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Medium Medium
    • Guilin Release
    • None
    • SDC
    • None

      The substitution mapping for a topology template should contain a mapping of properties of the node type to inputs for each property that is defined as an input

      When a service is defined in UDS we need to be able add to the substitution_mappings for the service, a mapping from the properties of the node type in the substitution mapping to inputs of the topology.

      For example if we create a service in UDS today, add a property to it called myProp, and define that it should be an input, the below is what is generated for the tosca template for the service (with no resources added to the service):

      tosca_definitions_version: tosca_simple_yaml_1_1
      metadata:
        invariantUUID: becb228c-ec57-4660-a76e-3f087c367c4f
        UUID: 55270165-922f-4c7e-8337-0213b2f9092e
        name: myTestService
        description: x
        type: Service
        category: Network L1-3
        serviceType: ''
        serviceRole: ''
        instantiationType: A-la-carte
        serviceEcompNaming: 'true'
        ecompGeneratedNaming: 'true'
        namingPolicy: ''
        environmentContext: General_Revenue-Bearing
        serviceFunction: ''
      imports:
      - nodes:
          file: nodes.yml
      - datatypes:
          file: data.yml
      - capabilities:
          file: capabilities.yml
      - relationships:
          file: relationships.yml
      - groups:
          file: groups.yml
      - policies:
          file: policies.yml
      - service-myTestService-interface:
          file: service-Mytestservice-template-interface.yml
      topology_template:
        inputs:
          myProp:
            type: string
            required: false
          skip_post_instantiation_configuration:
            default: true
            type: boolean
            required: false
          controller_actor:
            default: SO-REF-DATA
            type: string
            required: false
          cds_model_version:
            type: string
            required: false
          cds_model_name:
            type: string
            required: false
        substitution_mappings:
          node_type: org.openecomp.service.Mytestservice

       with the following definition for the node type 

      tosca_definitions_version: tosca_simple_yaml_1_1
      metadata:
        invariantUUID: becb228c-ec57-4660-a76e-3f087c367c4f
        UUID: 55270165-922f-4c7e-8337-0213b2f9092e
        name: myTestService
        description: x
        type: Service
        category: Network L1-3
        serviceType: ''
        serviceRole: ''
        instantiationType: A-la-carte
        serviceEcompNaming: 'true'
        ecompGeneratedNaming: 'true'
        namingPolicy: ''
        environmentContext: General_Revenue-Bearing
        serviceFunction: ''
      imports:
      - nodes:
          file: nodes.yml
      - datatypes:
          file: data.yml
      - capabilities:
          file: capabilities.yml
      - relationships:
          file: relationships.yml
      - groups:
          file: groups.yml
      - policies:
          file: policies.yml
      - service-myTestService-interface:
          file: service-Mytestservice-template-interface.yml
      topology_template:
        inputs:
          myProp:
            type: string
            required: false
          skip_post_instantiation_configuration:
            default: true
            type: boolean
            required: false
          controller_actor:
            default: SO-REF-DATA
            type: string
            required: false
          cds_model_version:
            type: string
            required: false
          cds_model_name:
            type: string
            required: false
        substitution_mappings:
          node_type: org.openecomp.service.Mytestservice

      What we need here is for the following to be automatically added to the substitution_mappings in the tosca template:

        substitution_mappings:
          node_type: org.openecomp.service.Mytestservice
          properties:
            myProp: [ myProp ]

      The information necessary is already present in the model and no user input is required, so the impact here is in the generation of the tosca from the model

            aribeiro aribeiro
            aribeiro aribeiro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: