Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • TOSCA language could be found here: https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.pdf
  • A yaml file contains only one service template
  • TOSCA Service Templates MUST always have, as the first line of YAML, the keyword “tosca_definitions_version” with an associated TOSCA Namespace Alias value.
  • A service template could import other service templates
  • namespace as URI could be an issue if used as id of a resource
  • name could be extracted as host of the namespace, and version could be extracted from the postfix of the namespace.
    • A pattern could be like a http://{host_namespace}/service/
    namespace
    • template/{x}/{y}/{z}. As example "http://tosca/service/
    namespace
    • template/0/0/1" we can extract name: "tosca" and version: "0.0.1"
    • Version could be omitted: http://{host_namespace}/service/template. As example "http://tosca/service/template/onap/org" we can extract name: "tosca" and default version: "0.0.1"
  • http://tosca/service/template/onap/org namespace/0/0/1 could be used as default namespace default
  • name and version will be not present into the yaml file (service template) as now, but we can continue to use them as id of a resource
  • host will be used as key to reference to external service template, and with "namespace_prefix" will be used to avoid collisions with same host but different version
  • about type and type_version backward compatibility still valid
  • type_version will be deprecated, type will be used as formatted string as follow:
    • {type}
    • {type}:{type_version}
    • {host_namespace}:{type}:{type_version}


tosca001.yaml

Code Block
languageyml
titleServiceTemplate001.yaml
tosca_definitions_version: tosca_simple_yaml_1_1_0
node_types:
  org.onap.nodeTypeA:
    derived_from: tosca.nodetypes.Root

  org.onap.nodeTypeB:
    derived_from: org.onap.nodeTypeA
    version: 1.2.3

  topology_template:
    node_templates:
      nodeTemplate01:
        version: 4.5.6
        type: org.onap.nodeTypeB
        type_version: 1.2.3


ServiceTemplate002.yaml

Code Block
languageyml
titleServiceTemplate002.yaml
tosca_definitions_version: tosca_simple_yaml_1_1_0
namespace: http://ServiceTemplate/service/template/onap/org/0/0/2

imports:
  - repository: http://tosca/service/template/onap/org
    namespace_prefix: defaultST

node_types:
  org.onap.nodeTypeC:
    derived_from: defaultST:org.onap.nodeTypeA
    version: 2.3.4

  topology_template:
    node_templates:
      nodeTemplate02:
        version: 5.6.7
        type: defaultST:org.onap.nodeTypeB
        type_version: 1.2.3

      nodeTemplate03:
        version: 6.7.8
        type: defaultST:org.onap.nodeTypeB:1.2.3
       nodeTemplate04:
        version: 7.8.9
        type: org.onap.nodeTypeC
        type_version: 2.3.4

      nodeTemplate05:
        version: 8.9.10
        type: org.onap.nodeTypeC:2.3.4


ServiceTemplate003.yaml

Code Block
languageyml
titleServiceTemplate003.yaml
tosca_definitions_version: tosca_simple_yaml_1_1_0
namespace: http://ServiceTemplate/onap.org/service/template/onap/org/0/0/3

imports:
  - repository: http://tosca/service/template/onap/org
    namespace_prefix: defaultST
  - repository: http://ServiceTemplate/service/template/onap/org/0/0/2
    namespace_prefix: st02

node_types:
  org.onap.nodeTypeZ:
    derived_from: defaultST:org.onap.nodeTypeA
    version: 9.3.4

  org.onap.nodeTypeY:
    derived_from: st02:org.onap.nodeTypeA
    version: 9.3.4

  topology_template:
    node_templates:
      nodeTemplate10:
        version: 9.6.7
        type: defaultST:org.onap.nodeTypeB:1.2.3

      nodeTemplate11:
        version: 9.8.9
        type: org.onap.nodeTypeZ:2.3.4
  

Validation

Validation in current ORM layer

...