Versions Compared

Key

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


...

Table of Contents

...

linenumberstrue
collapsetrue

...

Overview

This example includes the models of two services. These services are very loosely coupled. None of them contains any direct reference to another. In fact, they are totally unaware of the existence of each another. The relationship between them is established by the orchestrator in runtime based on a few global type definitions.

Shared type definitions

These definitions are included into both the providing and the consuming services.

Core DM Types

Node type onap.nodes.Service

Node type onap.nodes.Resource

Node type onap.nodes.NetworkFunction

Capability type onap.capabilities,AllottedResorceProvider

Relationship type onap.relationships.AllottedBy

Imaginary Types made up for this example

Code Block
titleCapability type onap.examples.capabilities.Firewall
linenumberstrue
collapsetrue
capability_types:
  onap.examples.nodescapabilities.Firewall:
    derived_from: tosca.nodescapabilities.Root
    description: an abstractability firewallto serve as   capabilities:
      i_can_be_a_firewall:
        type: a firewall
capabilities.Firewall onap.nodes.Service onap.capabilities.AllottedResourceProvider onap.relationships.AllottedBy
Code Block
titleNode type onap.examples.
node.Firewall
linenumberstrue
collapsetrue
node_types:
  onap.examples.nodes.FirewallShareFirewall:
    derived_from: onaptosca.examples.nodes.FirewallRoot
    description: an abstract firewall
    capabilities:
      i_can_be_a_firewall:
        type: onap.examples.capabilities.Firewall  
    requirements:
      - i_need_a_providing_service:
          capability: onap.capabilities.AllottedResourceProvider  

        
########## Providing Service        


Providing Service

The Providing Service CSAR will include these definitions and templates along with the Shared Type Definitions.


An implementation of the onap.capabilities.AllottedResource by the providing vendor.

The providing service will most likely define its own subtype the ONAP DM's onap.capabilities.AllottedResourceProvider capability type - to augment this core type with its own properties and a restricted list of valid source types.

Code Block
titleThe specialized capability type
linenumberstrue
collapsetrue
capability_types:
  vendorXXX.capabilities.FirewallsProvider:
    derived_from: onap.capabilities.AllottedResourceProvider
    valid_source_types: [onap.examples.nodes.Firewall]
    

The "Interface node type" for this service 

According to the Service Model Principles, any service definition will include a node type derived from onap.nodes.Service. This is a general ONAP service modeling convention rather than something specific for AR providing services. Just to remind - this type may be later use to create nodes of embedded services in a higher-order topology.

Code Block
titleProviding Service, "interface" node type
linenumberstrue
collapsetrue
node_types:
  vendorXXX.nodes.FirewallsProvidingService:
    derived_from: onap.nodes.Service
    capabilities:
      i_can_provide_firewalls:
        type: vendorXXX.capabilities.FirewallsProvider
        
  


Firewall implementation node type

This is a concrete node type, implementing the shared generic type definition of onap.examples.nodes.Firewall.

Code Block
titleFirewall implementing node type
linenumberstrue
collapsetrue
node_types:
  vendorXXX.nodes.MyVerySpecialFirewall:
    derived_from: onap.examples.nodes.Firewall
    capabilities:
      i_can_be_a_firewallsfirewall:
        type: vendorXXX.capabilities.Firewall
      i_can_provide_firewalls:
        type: vendorXXX.capabilities.FirewallsProvider
    topology_templateproperties:
      # extra props
 node_templates:   interfaces:
      firewalls_managerStandard:
       type create: ....my_creation_script.sh # AR creation logic
         capabilities:delete: my_delete_script.sh

The example above shows one of the possible ways to implement a node type, through implementation script artifacts. These scripts may include a special logic that communicates to a "factory" node inside the service. In this example, the capability of being a firewall and the capability of providing firewall are combined in one node. More elaborate designs may separate these functionalities and have a dedicated node for each of them.

All other TOSCA ways to implement an abstract node are also valid. Foe example, a vendor may choose to have an implementing (substituting) topology for this node type.

Providing service topology

Service Model Principles stipulate that any ONAP service definition includes, besides the "interface" node type, the implementing topology. The AR services are no exception of this principle.

Code Block
titleAR Providing Service Topology
linenumberstrue
collapsetrue
topology_template:       
  i_can_provide_firewalls:node_templates:
    my_firewall:
      type: vendorXXX.capabilitiesnodes.FirewallsProviderMyVerySpecialFirewall
           
  substitution_mappings:
    type: vendorXXX.nodes.FirewallsProvidingService
    capabilities:
      i_can_provide_firewalls: [firewallsmy_managerfirewall, i_can_provide_firewalls]
       


Consuming Service


The "Interface node type" of the Consuming Service 

The Consuming service definition, like any other ONAP service definition, will include an "interface node type". Its details are irrelevant for this example.


Consuming Service Topology

The service topology includes firewall abstract nodes.

Code Block
titleConsuming service topology
linenumberstrue
collapsetrue
node_types:
  onap.examples.nodes.FirewallShare:
    derived_from: onap.examples.nodes.Firewall
####################### Consuming service  topology_templatedescription: an  node_templates:abstract firewall as AR
    requirements:
 # A more released abstraction of- i_need_a_providing_service:
firewall, can be implemented by any way including an allotted resource
capability: onap.capabilities.AllottedResourceProvider 


firewalltopology_1template:
      typenode_templates:
onap.examples.nodes.Firewall 
    # A more restrictedreleased abstraction - mustof a firewall, can be resolvedimplemented by any way including an allotted resource
    firewall_21:
      type: onap.examples.nodes.FirewallShareFirewall
 
    # A verymore specificrestricted firewallabstraction - must be resolved by an allotted resource of the specific type
    firewall_32:
      type: vendorXXXonap.examples.nodes.FirewallShare