You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 34 Next »


TOSCA based JSON formatted model following standard: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html

Most of the TOSCA modeled entity presented in the bellow documentation can be found here: git-link

Tosca Model Reference: 

Controller Blueprint Archived (.cba)

The Controller Blueprint Archive is the overall service design, fully model-driven, intent based package needed for SELF SERVICE provisioning and configuration management automation.

In Dublin release, the CDS community has contributed a framework to automate the resolution of resources for instantiation and any config provisioning operation, such as day0, day1 or day2 configuration.

The content of the CBA Package is driven from the catalog of reusable data dictionary, component and workflow, delivering a reusable and simplified self service experience.

The CBA is .zip file, comprised of the following folder structure, the files may vary:

├── Definitions
│   ├── blueprint.json							overall TOSCA modeled blueprint
│   ├── artifact_types.json 					(generated)
│   ├── data_types.json 						(generated)
│   ├── node_types.json 						(generated)
│   ├── policy_types.json 						(generated)
│   ├── relationship_types.json 				(generated)
│   ├── resources_definition_types.json 		(generated based on data dictionary)
│   └── *-mapping.json							one per template
├── Environments
├── Plans
│   ├── ResourceAssignment.xml					DG backing the resource-assignment Workflow (name is free for all)
│   ├── ConfigAssign.xml						DG backing the config-assign Workflow (name is free for all)
│   └── ConfigDeploy.xml						DG backing the config-deploy Workflow (name is free for all)
├── Scripts
│   └── python
│       ├── ConfigDeployExample.py				Python script using python Netconf client
│       ├── ResourceResolutionExample.py		Python script with logic to resolve a parameter
│       └── __init__.py
├── TOSCA-Metadata
│   └── TOSCA.meta								Meta-data of overall package
└── Templates
    └── *-template.vtl							one per template


Flexible Plug-In Architecture

Interaction with external systems is made plug-able within the CDS design.

Currently, REST or SQL external systems are supported.

An external system might be used by multiple resources, or by multiple scripts.

In order to share the external system information, TOSCA provides a way to create macros using dsl_definitions:

Artifact Type

Represents the type of a file, used to target according implementation.

TOSCA definition: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454213

The tosca.artifacts.Implementation was created, derived from tosca.artifacts.Root

git-link

tosca.artifacts.Implementation
{
  "description": "TOSCA base type for implementation artifacts",
  "version": "1.0.0",
  "derived_from": "tosca.artifacts.Root"
}

Bellow is a list of supported artifact types.

artifact-mapping-resource

This type is meant to represent mapping files. Defines the contract of each resource to be resolved. Each placeholder in a template must have a corresponding mapping definition, see CDS Modeling Concepts. File must have .json extension.

git-link

artifact-mapping-resource
{
  "description": "Resource Mapping File used along with Configuration template",
  "version": "1.0.0",
  "file_ext": [
    "json"
  ],
  "derived_from": "tosca.artifacts.Implementation"
}

artifact-template-velocity

Represents an Apache Velocity template. Apache Velocity allows you to insert logic (if / else / loops / etc) when processing the output of a template/text. File must have .vtl extension.

A template can represent anything, such as device config, payload to interact with 3rd party systems, resource-accumulator template, etc...

Velocity reference document: http://velocity.apache.org/engine/1.7/user-guide.html

git-link

artifact-template-velocity
{
  "description": " Velocity Template used for Configuration",
  "version": "1.0.0",
  "file_ext": [
    "vtl"
  ],
  "derived_from": "tosca.artifacts.Implementation"
}

artifact-directed-graph

Represents a direct graph. File must have .json or .xml extension.

git-link

artifact-directed-graph
{
  "description": "Directed Graph File",
  "version": "1.0.0",
  "file_ext": [
    "json",
    "xml"
  ],
  "derived_from": "tosca.artifacts.Implementation"
}

Node type

Represents a re-usable entity using to define a manageable software component.

TOSCA definition: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454215

tosca.nodes.Component

This is the root level for all component functionalities.

tosca.nodes.Component
{
  "description": "This is default Component Node",
  "version": "1.0.0",
  "derived_from": "tosca.nodes.Root"
}

tosca.nodes.component.Jython

Identifies the Jython component, used to process Python code through Java.

See more about Jython: https://www.jython.org/

tosca.nodes.component.Jython
{
  "description": "This is Jython Component",
  "version": "1.0.0",
  "derived_from": "tosca.nodes.Root"
}

tosca.nodes.component.Kotlin

Identifies the Koltin script component, used to process Kotlin script.

tosca.nodes.component.Kotlin
{
  "description": "This is Kotlin Component",
  "version": "1.0.0",
  "derived_from": "tosca.nodes.Root"
}

tosca.nodes.VNF

Identifies a VNF, can be used to correlate any type of VNF related information.

tosca.nodes.vnf
{
  "description": "This is VNF Node Type",
  "version": "1.0.0",
  "derived_from": "tosca.nodes.Root"
}

vnf-netconf-device

Represents the VNF information to establish a NETCONF communication.

vnf-netconf-device
{
  "description": "This is VNF Device with Netconf  Capability",
  "version": "1.0.0",
  "capabilities": {
    "netconf": {
      "type": "tosca.capabilities.Netconf",
      "properties": {
        "login-key": {
          "required": true,
          "type": "string",
          "default": "sdnc"
        },
        "login-account": {
          "required": true,
          "type": "string",
          "default": "sdnc-tacacs"
        },
        "source": {
          "required": false,
          "type": "string",
          "default": "npm"
        },
        "target-ip-address": {
          "required": true,
          "type": "string"
        },
        "port-number": {
          "required": true,
          "type": "integer",
          "default": 830
        },
        "connection-time-out": {
          "required": false,
          "type": "integer",
          "default": 30
        }
      }
    }
  },
  "derived_from": "tosca.nodes.Vnf"
}

tosca.nodes.ResourceSource

Identifies a resource source, used during resource resolution.

tosca.nodes.ResourceSource
{
  "description": "TOSCA base type for Resource Sources",
  "version": "1.0.0",
  "derived_from": "tosca.nodes.Root"
}

Data type

Represents the schema of a specific type of data.

Supports both primitive and complex data type, complex being a list or a structure.

TOSCA definition: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454187

datatype-resource-assignment

Used to define CDS Modeling Concepts

That datatype represent an resource to be resolved.

PropertyDescription
input-paramWhether the resource can be provided as input.
dictionary-nameReference to the name of the data dictionary (see CDS Modeling Concepts).
dictionary-sourceReference the source to use to resolve the resource (see Resource source).
dependenciesList of dependencies required to resolve this resource.
updated-dateDate when mapping was upload.
updated-byName of the person that updated the mapping.

Here is the model

datatype-resource-assignment
{
	"version": "1.0.0",
	"description": "This is Resource Assignment Data Type",
	"properties": {
		"property": {
			"required": true,
			"type": "datatype-property"
		},
		"input-param": {
			"required": true,
			"type": "boolean"
		},
		"dictionary-name": {
			"required": false,
			"type": "string"
		},
		"dictionary-source": {
			"required": false,
			"type": "string"
		},
		"dependencies": {
			"required": true,
			"type": "list",
			"entry_schema": {
				"type": "string"
			}
		},
		"updated-date": {
			"required": false,
			"type": "string"
		},
		"updated-by": {
			"required": false,
			"type": "string"
		}
	},
	"derived_from": "tosca.datatypes.Root"
}

Component

Represents a functionality.

component-resource-resolution

Used to perform resolution of resources.

Make use of CDS Modeling Concepts and CDS Modeling Concepts

component-resource-resolution
{
  "description": "This is Resource Assignment Component API",
  "version": "1.0.0",
  "attributes": {
    "assignment-params": {
      "required": true,
      "type": "string"
    }
  },
  "capabilities": {
    "component-node": {
      "type": "tosca.capabilities.Node"
    }
  },
  "interfaces": {
    "ResourceResolutionComponent": {
      "operations": {
        "process": {
          "inputs": {
            "resolution-key": {
              "description": "Key for service instance related correlation.",
              "required": false,
              "type": "string"
            },
            "store-result": {
              "description": "Whether or not to store the output.",
              "required": false,
              "type": "boolean"
            },
            "artifact-prefix-names": {
              "required": true,
              "description": "Template , Resource Assignment Artifact Prefix names",
              "type": "list",
              "entry_schema": {
                "type": "string"
              }
            },
            "dynamic-properties": {
              "description": "Dynamic Json Content or DSL Json reference.",
              "required": false,
              "type": "json"
            }
          },
          "outputs": {
            "resource-assignment-params": {
              "required": true,
              "type": "string"
            },
            "status": {
              "required": true,
              "type": "string"
            }
          }
        }
      }
    }
  },
  "derived_from": "tosca.nodes.Component"
}

component-jython-executor

Use to execute python scripts.

component-jython-executor
{
  "description": "This is Jython Execution Component.",
  "version": "1.0.0",
  "capabilities": {
    "component-node": {
      "type": "tosca.capabilities.Node"
    }
  },
  "interfaces": {
    "ComponentJythonExecutor": {
      "operations": {
        "process": {
          "inputs": {
            "instance-dependencies": {
              "required": true,
              "description": "Instance Names to Inject to Jython Script.",
              "type": "list",
              "entry_schema": {
                "type": "string"
              }
            },
            "dynamic-properties": {
              "description": "Dynamic Json Content or DSL Json reference.",
              "required": false,
              "type": "json"
            }
          },
          "outputs": {
            "response-data": {
              "description": "Execution Response Data in JSON format.",
              "required": false,
              "type": "string"
            },
            "status": {
              "description": "Status of the Component Execution ( success or failure )",
              "required": true,
              "type": "string"
            }
          }
        }
      }
    }
  },
  "derived_from": "tosca.nodes.component.Jython"
}

component-netconf-executor

Use to execute NETCONF commands within a script.

component-netconf-executor
{
  "description": "This is Netconf Transaction Configuration Component API",
  "version": "1.0.0",
  "capabilities": {
    "component-node": {
      "type": "tosca.capabilities.Node"
    }
  },
  "requirements": {
    "netconf-connection": {
      "capability": "netconf",
      "node": "vnf-netconf-device",
      "relationship": "tosca.relationships.ConnectsTo"
    }
  },
  "interfaces": {
    "ComponentNetconfExecutor": {
      "operations": {
        "process": {
          "inputs": {
            "script-type": {
              "description": "Script type, kotlin type is supported",
              "required": true,
              "type": "string",
              "default": "internal",
              "constraints": [
                {
                  "valid_values": [
                    "kotlin",
                    "jython",
                    "internal"
                  ]
                }
              ]
            },
            "script-class-reference": {
              "description": "Kotlin Script class name or jython script name.",
              "required": true,
              "type": "string"
            },
            "instance-dependencies": {
              "required": true,
              "description": "Instance names to inject to Jython or Kotlin Script.",
              "type": "list",
              "entry_schema": {
                "type": "string"
              }
            },
            "dynamic-properties": {
              "description": "Dynamic Json Content or DSL Json reference.",
              "required": false,
              "type": "json"
            }
          },
          "outputs": {
            "response-data": {
              "description": "Execution Response Data in JSON format.",
              "required": false,
              "type": "string"
            },
            "status": {
              "description": "Status of the Component Execution ( success or failure )",
              "required": true,
              "type": "string"
            }
          }
        }
      }
    }
  },
  "derived_from": "tosca.nodes.Component"
}

component-restconf-executor

Use to execute RESTCONF commands within a script.

component-restconf-executor
{
  "description": "This is Restconf Transaction Configuration Component API",
  "version": "1.0.0",
  "capabilities": {
    "component-node": {
      "type": "tosca.capabilities.Node"
    }
  },
  "interfaces": {
    "ComponentRestconfExecutor": {
      "operations": {
        "process": {
          "inputs": {
            "script-type": {
              "description": "Script type, kotlin type is supported",
              "required": true,
              "type": "string",
              "default": "internal",
              "constraints": [
                {
                  "valid_values": [
                    "kotlin",
                    "jython",
                    "internal"
                  ]
                }
              ]
            },
            "script-class-reference": {
              "description": "Kotlin Script class name or jython script name.",
              "required": true,
              "type": "string"
            },
            "instance-dependencies": {
              "required": true,
              "description": "Instance names to inject to Jython or Kotlin Script.",
              "type": "list",
              "entry_schema": {
                "type": "string"
              }
            },
            "dynamic-properties": {
              "description": "Dynamic Json Content or DSL Json reference.",
              "required": false,
              "type": "json"
            }
          },
          "outputs": {
            "response-data": {
              "description": "Execution Response Data in JSON format.",
              "required": false,
              "type": "string"
            },
            "status": {
              "description": "Status of the Component Execution ( success or failure )",
              "required": true,
              "type": "string"
            }
          }
        }
      }
    }
  },
  "derived_from": "tosca.nodes.Component"
}

Workflow

A workflow defines an overall action to be taken for the service; it can be composed of a set of sub-actions to execute.

Currently, workflows are backed by Directed Graph engine, and are imperative workflow.

A CBA can have as many workflow as needed.

TOSCA definition: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454203

Template

A template is an artifact, and uses CDS Modeling Concepts and artifact-template-velocity.

A template is parameterized and each parameter must be defined in a corresponding mapping file.

In order to know which mapping correlate to which template, the file name must start with an artifact-prefix, serving as identifier to the overall template + mapping.

The requirement is as follow:

${artifact-prefix}-template
${artifact-prefix}-mapping

Resource accumulator

In order to resolve HEAT environment variables, resource accumulator templates are being in used in Dublin.

These templates are specific to the pre-instantiation scenario, and relies on GR-API within SDNC.

It is composed of the following sections:

  • resource-accumulator-resolved-data: defines all the resources that can be resolved directly from the context. It expresses a direct mapping between the name of the resource and its value.

  • capability-data: defines what capability to use to create a specific resource, along with the ingredients required to invoke the capability and the output mapping.

Scripts

Library

NetconfClient

In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available. This NetconfClient can be used when using the component-netconf-executor.

The client can be find here: https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py

ResolutionHelper

When executing a component executor script, designer might want to perform resource resolution along with template meshing directly from the script itself.

The helper can be find here: https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/common.py

Resource Definition aka Data dictionary

A data dictionary models the how a specific resource can be resolved.

A resource is a variable/parameter in the context of the service. It can be anything, but it should not be confused with SDC or Openstack resources.

A data dictionary can have multiple sources to handle resolution in different ways.

The main goal of data dictionary is to define re-usable entity that could be shared.

Creation of data dictionaries is a standalone activity, separated from the blueprint desig

As part of modelling a data dictionary entry, the following generic information should be provided:

PropertyDescriptionScope
nameData dictionary nameMandatory
tagsInformation relatedMandatory
updated-byThe creatorMandatory
propertyDefines type and description, as nested JSONMandatory
sourcesList of resource sourceMandatory

Bellow are properties that all the resource source have will have

The modeling does allow for data translation between external capability and CDS for both input and output key mapping.

PropertyDescriptionScope
input-key-mappingmap of resources required to perform the request/query. The left hand-side is what is used within the query/request, the right hand side refer to a data dictionary instance.Optional
output-key-mappingname of the resource to be resolved mapped to the value resolved by the request/query.Optional
key-dependencies

list of data dictionary instances to be resolved prior the resolution of this specific resource.

during run time execution the key dependencies are recursively sorted and resolved in batch processing using the acyclic graph algorithm.

Optional

Example:
vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.

Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:

vf-module-label data dictionary
{
  "name" : "vf-module-label",
  "tags" : "vf-module-label",
  "updated-by" : "adetalhouet",
  "property" : {
    "description" : "vf-module-label",
    "type" : "string"
  },
  "sources" : {
    "primary-db" : {
      "type" : "source-primary-db",
      "properties" : {
        "type" : "SQL",
        "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
        "input-key-mapping" : {
          "customizationid" : "vf-module-model-customization-uuid"
        },
        "output-key-mapping" : {
          "vf-module-label" : "vf_module_label"
        },
        "key-dependencies" : [ "vf-module-model-customization-uuid" ]
      }
    }
  }
}

Regardless the source used within a Data Dictionary, the resource value can be overridden through input.

Resource source

Defines the contract to resolve a resource.

A resource source is modeled, following TOSCA node_type definition, and derives from the tosca.nodes.Root

Uses tosca.nodes.ResourceSource

ONAP defines common resource source definitions, derived by the tosca.nodes.ResourceSource

Input

Expects the value to be provided as input to the request.

git link

source-input
{
  "description": "This is Input Resource Source Node Type",
  "version": "1.0.0",
  "properties": {},
  "derived_from": "tosca.nodes.ResourceSource"
}

Default

Expects the value to be defaulted in the model itself.

git link

source-default
{
  "description": "This is Default Resource Source Node Type",
  "version": "1.0.0",
  "properties": {},
  "derived_from": "tosca.nodes.ResourceSource"
}

SQL

Expects the SQL query to be modeled; that SQL query can be parameterized, and the parameters be other resources resolved through other means. If that's the case, this data dictionary definition will have to define key-dependencies along with input-key-mapping.

CDS is currently deployed along the side of SDNC, hence the primary database connection provided by the framework is to SDNC database.

git-link

PropertyDescriptionScope
typeDatabase type, only SQL supported for nowMandatory
endpoint-selectorSpecify which database to connect toOptional
queryStatement to executeMandatory
source-primary-db
{
  "description": "This is Database Resource Source Node Type",
  "version": "1.0.0",
  "properties": {
    "type": {
      "required": true,
      "type": "string",
      "constraints": [
        {
          "valid_values": [
            "SQL"
          ]
        }
      ]
    },
    "endpoint-selector": {
      "required": false,
      "type": "string"
    },
    "query": {
      "required": true,
      "type": "string"
    },
    "input-key-mapping": {
      "required": false,
      "type": "map",
      "entry_schema": {
        "type": "string"
      }
    },
    "output-key-mapping": {
      "required": false,
      "type": "map",
      "entry_schema": {
        "type": "string"
      }
    },
    "key-dependencies": {
      "required": true,
      "type": "list",
      "entry_schema": {
        "type": "string"
      }
    }
  },
  "derived_from": "tosca.nodes.ResourceSource"
}

Connection to a specific database can be expressed through the endpoint-selector property, which refers to a macro defining the information about the database the connect to. Understand TOSCA Macro in the context of CDS.

db-system
"dsl_definitions": {
  "dynamic-db-source": {
    "type": "maria-db",
    "url": "jdbc:mysql://localhost:3306/sdnctl",
    "username": "sdnctl",
    "password": "sdnctl"
  }
}

REST

Expects the URI along with the VERB and the payload, if needed.

CDS is currently deployed along the side of SDNC, hence the default rest connection provided by the framework is to SDNC MDSAL.

git-link

PropertyDescriptionScope
typeExpected output value, only JSON supported for nowOptional
verbHTTP verb for the request - default value is GETOptional
payload
Optional
endpoint-selectorSpecify which REST system to connect toOptional

url-path

URIMandatory
pathJSON path to the value to fetch from the responseMandatory

expression-type

Path expression type - default value is JSON_PATHOptional
source-rest
{
  "description": "This is Rest Resource Source Node Type",
  "version": "1.0.0",
  "properties": {
    "type": {
      "required": false,
      "type": "string",
      "default": "JSON",
      "constraints": [
        {
          "valid_values": [
            "JSON"
          ]
        }
      ]
    },
    "verb": {
      "required": false,
      "type": "string",
      "default": "GET",
      "constraints": [
        {
          "valid_values": [
            "GET", "POST", "DELETE", "PUT"
          ]
        }
      ]
    },
    "payload": {
      "required": false,
      "type": "string",
      "default": ""
    },
    "endpoint-selector": {
      "required": false,
      "type": "string"
    },
    "url-path": {
      "required": true,
      "type": "string"
    },
    "path": {
      "required": true,
      "type": "string"
    },
    "expression-type": {
      "required": false,
      "type": "string",
      "default": "JSON_PATH",
      "constraints": [
        {
          "valid_values": [
            "JSON_PATH",
            "JSON_POINTER"
          ]
        }
      ]
    },
    "input-key-mapping": {
      "required": false,
      "type": "map",
      "entry_schema": {
        "type": "string"
      }
    },
    "output-key-mapping": {
      "required": false,
      "type": "map",
      "entry_schema": {
        "type": "string"
      }
    },
    "key-dependencies": {
      "required": true,
      "type": "list",
      "entry_schema": {
        "type": "string"
      }
    }
  },
  "derived_from": "tosca.nodes.ResourceSource"
}

Connection to a specific REST system can be expressed through the endpoint-selector property, which refers to a macro defining the information about the REST system the connect to. Understand TOSCA Macro in the context of CDS.

Few ways are available to authenticate to the REST system:

  • token-auth
    "dsl_definitions": {
      "dynamic-rest-source": {
    	"type" : "token-auth",
    	"url" : "http://localhost:32778",
    	"token" : "Token 0123456789abcdef0123456789abcdef01234567"
      }
    }
  • basic-auth
    "dsl_definitions": {
      "dynamic-rest-source": {
    	"type" : "basic-auth",
    	"url" : "http://localhost:32778",
    	"username" : "bob",
    	"password": "marley"
     }
    }
  • TBD - The trustore and the keystore can be provide as environment through the Environment folder in the CBA.

    ssl-basic-auth
    "dsl_definitions": {
      "dynamic-rest-source": {
    	"type" : "ssl-basic-auth",
    	"url" : "http://localhost:32778",
    	"keyStoreInstance": "JKS or PKCS12",
    	"sslTrust": "trusture",
    	"sslTrustPassword": "trustore password",
    	"sslKey": "keystore",
    	"sslKeyPassword: "keystore password"
     }
    }

Capability

Excepts a script to be provided.

git-link

PropertyDescriptionScope
script-typeThe type of the script - default value is KoltinOptional

script-class-reference

The name of the class to use to create an instance of the scriptMandatory
instance-dependencies

Platform dependencies to be injected within the script instance.

Available dependencies are:

  • resource-resolution-service

  • blueprint-rest-lib-property-service

  • ... TDB
Optional
source-capability
{
  "description": "This is Component Resource Source Node Type",
  "version": "1.0.0",
  "properties": {
    "script-type": {
      "required": true,
      "type": "string",
      "default": "kotlin",
      "constraints": [
        {
          "valid_values": [
            "kotlin",
            "jython"
          ]
        }
      ]
    },
    "script-class-reference": {
      "description": "Capability reference name for internal and kotlin, for jython script file path",
      "required": true,
      "type": "string"
    },
    "instance-dependencies": {
      "required": false,
      "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
      "type": "list",
      "entry_schema": {
        "type": "string"
      }
    },
    "key-dependencies": {
      "description": "Resource Resolution dependency dictionary names.",
      "required": true,
      "type": "list",
      "entry_schema": {
        "type": "string"
      }
    }
  },
  "derived_from": "tosca.nodes.ResourceSource"
}
  • No labels