1 .. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-703799064
2 .. This work is licensed under a Creative Commons Attribution 4.0
3 .. International License. http://creativecommons.org/licenses/by/4.0
4 .. Copyright (C) 2020 Deutsche Telekom AG.
12 <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454215>`_
14 In CDS, we have mainly two distinct types: components and source. We have some other type as well,
15 listed in the other section.
23 Used to represent a **functionality** along with its **contract**, such as **inputs**, **ouputs**, and **attributes**
25 `Component type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Component.json>`_
26 is the root component TOSCA node type from which other node type will derive:
29 :caption: **tosca.nodes.Component**
32 "description": "This is default Component Node",
34 "derived_from": "tosca.nodes.Root"
37 **Bellow is a list of supported components**
41 .. tab:: resource-resolution
43 **component-resource-resolution:**
45 Used to perform resolution of **resources**.
47 Requires as many as artifact-mapping-resource (see :ref:`artifact_type` -> Mapping) AND
48 artifact-template-velocity (see :ref:`artifact_type` -> Jinja) as needed.
52 Will put the resolution result as an **attribute** in the workflow context called **assignment-params**.
54 Using the **get_attribute** expression, this attribute can be retrieve to be
55 provided as workflow output (see :ref:`workflow`).
57 **Specify which template to resolve:**
59 Currently, resolution is bounded to a template. To specify which template to use, you
60 need to fill in the `artifact-prefix-names` field.
62 See :ref:`template` to understand what the artifact prefix name is.
64 **Storing the result:**
66 To store each resource being resolved, along with their status, and the resolved template, `store-result` should be set to `true`.
68 Also, when storing the data, it must be in the context of either a `resource-id` and `resource-type`, or based on a given `resolution-key`
71 The concept of resource-id / resource-type, or resolution-key, is to uniquely identify a specific resolution that
72 has been performed for a given action. Hence the resolution-key has to be unique for a given blueprint name, blueprint version, action name.
74 Through the combination of the fields mentioned previously, one could retrieved what has been resolved. This is useful to manage the life-cycle of the resolved resource, the life-cycle of the template, along with sharing with external systems the outcome of a given resolution.
76 The resource-id / resource-type combo is more geared to uniquely identify a resource in AAI, or external system. For example, for a given AAI resource, say a PNF, you can trigger a given CDS action, and then you will be able to manage all the resolved resources bound to this PNF. Even we could have a history of what has been assigned, unassigned for this given AAI resource.
78 .. warning:: Important not to confuse and AAI resource (e.g. a topology element,
79 or service related element) with the resources resolved by CDS, which can be seen
80 as parameters required to derived a network configuration.
82 **Run the resolution multiple time:**
84 If you need to run the same resolution component multiple times, use the field `occurence`.
85 This will add the notion of occurrence to the resolution, and if storing the results, resources
86 and templates, they will be accessible for each occurrence.
88 Occurrence is a number between 1 and N; when retrieving information
89 for a given occurrence, the first iteration starts at 1.
91 This feature is useful when you need to apply the same configuration accross network elements.
93 `Resource resolution <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-resource-resolution.json>`_
97 :caption: **component-resource-resolution**
100 "description": "This is Resource Assignment Component API",
103 "assignment-params": {
110 "type": "tosca.capabilities.Node"
114 "ResourceResolutionComponent": {
119 "description": "Key for service instance related correlation.",
124 "description": "Number of time to perform the resolution.",
130 "description": "Whether or not to store the output.",
135 "description": "Request type.",
139 "artifact-prefix-names": {
141 "description": "Template , Resource Assignment Artifact Prefix names",
148 "description": "Request Id, Unique Id for the request.",
153 "description": "Resource Id.",
158 "description": "Action Name of the process",
162 "dynamic-properties": {
163 "description": "Dynamic Json Content or DSL Json reference.",
169 "resource-assignment-params": {
182 "derived_from": "tosca.nodes.Component"
185 .. tab:: script-executor
187 **component-script-executor:**
189 Used to **execute** a script to perform **NETCONF, RESTCONF, SSH commands**
190 from within the runtime container of CDS.
192 Two type of scripts are supported:
194 * Kotlin: offer a way more integrated scripting framework, along
195 with a way faster processing capability. See more about Kotlin script: https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md
196 * Python: uses Jython which is bound to Python 2.7, end of life Januray 2020.
197 See more about Jython: https://www.jython.org/
199 The `script-class-reference` field need to reference
201 * for kotlin: the package name up to the class. e.g. com.example.Bob
202 * for python: it has to be the path from the Scripts folder, e.g. Scripts/python/Bob.py
204 `Script executor type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-script-executor.json>`_
210 :caption: **component-script-executor**
213 "description": "This is Netconf Transaction Configuration Component API",
216 "ComponentScriptExecutor": {
221 "description": "Script type, kotlin type is supported",
224 "default": "internal",
235 "script-class-reference": {
236 "description": "Kotlin Script class name with full package or jython script name.",
240 "dynamic-properties": {
241 "description": "Dynamic Json Content or DSL Json reference.",
248 "description": "Execution Response Data in JSON format.",
253 "description": "Status of the Component Execution ( success or failure )",
262 "derived_from": "tosca.nodes.Component"
265 .. tab:: remote-script-executor
267 **component-remote-script-executor:**
269 Used to **execute** a python script in a dedicated micro-service, providing a Python 3.6 environment.
273 prepare-environment-logs: will contain the logs for all the pip install of ansible_galaxy setup
275 execute-command-logs: will contain the execution logs of the script, that were printed into stdout
277 Using the get_attribute expression (see :ref:`expression` -> get_attribute),
278 this attribute can be retrieve to be provided as workflow output (see :ref:`workflow`).
282 The `command` field need to reference the path from the Scripts folder of the
283 scripts to execute, e.g. Scripts/python/Bob.py
285 The `packages` field allow to provide a list of **PIP package** to install in the target environment,
286 or a requirements.txt file. Also, it supports **Ansible role**.
288 If **requirements.txt** is specified, then it should be **provided** as
289 part of the **Environment** folder of the CBA.
292 :caption: **Example**
302 "type": "ansible_galaxy",
309 The `argument-properties` allows to specified input argument to the script to execute. They should be
310 expressed in a DSL, and they will be ordered as specified.
313 :caption: **Example**
315 "ansible-argument-properties": {
317 "arg1": "Scripts/ansible/inventory.yaml",
318 "arg2": "--extra-vars",
321 "resolve-ansible-vars",
329 The `dynamic-properties` can be anything that needs to be passed to the
330 script that couldn't be passed as an argument, such as JSON object, etc... If used, they will be passed
331 in as the last argument of the Python script.
333 `Remote executor type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-remote-python-executor.json>`_
337 :caption: **component-remote-script-executor**
340 "description": "This is Remote Python Execution Component.",
343 "prepare-environment-logs": {
347 "execute-command-logs": {
361 "type": "tosca.capabilities.Node"
365 "ComponentRemotePythonExecutor": {
369 "endpoint-selector": {
370 "description": "Remote Container or Server selector name.",
373 "default": "remote-python"
375 "dynamic-properties": {
376 "description": "Dynamic Json Content or DSL Json reference.",
380 "argument-properties": {
381 "description": "Argument Json Content or DSL Json reference.",
386 "description": "Command to execute.",
391 "description": "Packages to install based on type.",
395 "type" : "dt-system-packages"
403 "derived_from": "tosca.nodes.Component"
406 .. tab:: remote-ansible-executor
408 **component-remote-ansible-executor:**
410 Used to **execute** an ansible playbook hosted in AWX/Anisble Tower.
414 ansible-command-status: status of the command
416 ansible-command-logs: will contain the execution logs of the playbook
418 Using the get_attribute expression, this attribute can be retrieve to be provided as workflow output (see Workflow).
424 `Ansible executor <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-remote-ansible-executor.json>`_
428 :caption: **component-remote-script-executor**
431 "description": "This is Remote Ansible Playbook (AWX) Execution Component.",
434 "ansible-command-status": {
438 "ansible-command-logs": {
445 "type": "tosca.capabilities.Node"
449 "ComponentRemoteAnsibleExecutor": {
453 "job-template-name": {
454 "description": "Primary key or name of the job template to launch new job.",
459 "description": "Specify host limit for job template to run.",
464 "description": "Specify inventory for job template to run.",
471 "description": "json formatted text that contains extra variables to pass on."
474 "description": "Specify tagged actions in the playbook to run.",
479 "description": "Specify tagged actions in the playbook to omit.",
483 "endpoint-selector": {
484 "description": "Remote AWX Server selector name.",
493 "derived_from": "tosca.nodes.Component"
500 Used to represent a **type of source** to **resolve** a **resource**, along with the expected **properties**
502 Defines the **contract** to resolve a resource.
504 `Resource source type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.ResourceSource.json>`_
505 is the root component TOSCA node type from which other node type will derive:
508 :caption: **tosca.nodes.Component**
511 "description": "TOSCA base type for Resource Sources",
513 "derived_from": "tosca.nodes.Root"
516 **Bellow is a list of supported sources**
524 Expects the **value to be provided as input** to the request.
526 `Input source <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-input.json>`_
530 :caption: **source-input**
533 "description": "This is Input Resource Source Node Type",
536 "derived_from": "tosca.nodes.ResourceSource"
543 Expects the **value to be defaulted** in the model itself.
545 `Default source type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-default.json>`_
549 :caption: **source-default**
552 "description": "This is Default Resource Source Node Type",
555 "derived_from": "tosca.nodes.ResourceSource"
562 Expects the **URI along with the VERB and the payload**, if needed.
564 CDS is currently deployed along the side of SDNC, hence the **default** rest
565 **connection** provided by the framework is to **SDNC MDSAL**.
575 - Expected output value, only JSON supported for now
578 - HTTP verb for the request - default value is GET
583 * - endpoint-selector
584 - **Specific REST system** to interact with to (see **Dynamic Endpoint**)
590 - JSON path to the value to fetch from the response
593 - Path expression type - default value is JSON_PATH
596 `Rest source <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-rest.json>`_
600 :caption: **source-rest**
603 "description": "This is Rest Resource Source Node Type",
638 "endpoint-selector": {
653 "default": "JSON_PATH",
663 "input-key-mapping": {
670 "output-key-mapping": {
677 "key-dependencies": {
685 "derived_from": "tosca.nodes.ResourceSource"
691 Expects the **SQL query** to be modeled; that SQL query can be parameterized,
692 and the parameters be other resources resolved through other means.
693 If that's the case, this data dictionary definition will have to define ``key-dependencies`` along with ``input-key-mapping``.
695 CDS is currently deployed along the side of SDNC, hence the **primary** database
696 **connection** provided by the framework is to **SDNC database**.
705 - Database type, only SQL supported for now
707 * - endpoint-selector
708 - Specific Database system to interact with to (see **Dynamic Endpoint**)
711 - Statement to execute
715 `DB source type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-processor-db.json>`_
719 :caption: **source-db**
722 "description": "This is Database Resource Source Node Type",
736 "endpoint-selector": {
744 "input-key-mapping": {
751 "output-key-mapping": {
758 "key-dependencies": {
766 "derived_from": "tosca.nodes.ResourceSource"
773 Expects a **script** to be provided.
783 - The type of the script - default value is Koltin
785 * - script-class-reference
786 - The name of the class to use to create an instance of the script
789 `Capability source type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/source-capability.json>`_
793 :caption: **source-capability**
796 "description": "This is Component Resource Source Node Type",
813 "script-class-reference": {
814 "description": "Capability reference name for internal and kotlin, for jython script file path",
818 "key-dependencies": {
819 "description": "Resource Resolution dependency dictionary names.",
827 "derived_from": "tosca.nodes.ResourceSource"
840 Identifies a Directed Graph used as **imperative workflow**.
849 * - dependency-node-templates
850 - The node template the workflow depends on
853 `DG source type <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/dg-generic.json>`_
857 :caption: **dg-generic**
860 "description": "This is Generic Directed Graph Type",
867 "dependency-node-templates": {
869 "description": "Dependent Step Components NodeTemplate name.",
876 "derived_from": "tosca.nodes.DG"
879 A node_template of this type always provide one artifact, of type artifact-directed-graph,
880 which will be located under the Plans/ folder within the CBA.
883 :caption: **node_template example**
886 "config-deploy-process": {
887 "type": "dg-generic",
892 "dg-config-deploy-process"
895 "dependency-node-templates": [
896 "nf-account-collection",
901 "dg-config-deploy-process": {
902 "type": "artifact-directed-graph",
903 "file": "Plans/CONFIG_ConfigDeploy.xml"
909 In the DG bellow, the execute node refers to the node_template.
912 :caption: **Plans/CONFIG_ConfigDeploy.xml**
915 xmlns='http://www.onap.org/sdnc/svclogic'
916 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
917 xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='CONFIG' version='1.0.0'>
918 <method rpc='ConfigDeploy' mode='sync'>
919 <block atomic="true">
920 <execute plugin="nf-account-collection" method="process">
921 <outcome value='failure'>
922 <return status="failure">
925 <outcome value='success'>
926 <execute plugin="execute" method="process">
927 <outcome value='failure'>
928 <return status="failure">
931 <outcome value='success'>
932 <return status='success'>
946 Identifies a VNF, can be used to **correlate** any type of **VNF** related **information**.
948 https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Vnf.json
951 :caption: **tosca.nodes.vnf**
954 "description": "This is VNF Node Type",
956 "derived_from": "tosca.nodes.Root"
959 **vnf-netconf-device**
961 Represents the VNF information to **establish** a **NETCONF communication**.
963 https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/vnf-netconf-device.json
966 :caption: **vnf-netconf-device**
969 "description": "This is VNF Device with Netconf Capability",
973 "type": "tosca.capabilities.Netconf",
983 "default": "sdnc-tacacs"
990 "target-ip-address": {
999 "connection-time-out": {
1007 "derived_from": "tosca.nodes.Vnf"