------------
|image1|
+
Data Flow
---------
|image2|
* EXPOSE 3000
* CMD [ "npm", "start" ]
+
Development
-----------
3. cd cds ; mvn clean install ; cd ..
4. Open the cds-ui/client code for development
+
Functional Decomposition
------------------------
|image3|
.. code-block:: none
- mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
+ mvn clean install -Pq -Dadditionalparam=-Xdoclint:none
Create the needed Docker images:
mvn clean install -Pdocker
+
Start Docker containers using docker-composer:
----------------------------------------------
The CBA is .zip file, which is saved in Controller Blueprint Database.
+
Controller Blueprint Microservices:
-----------------------------------
REST API request:
-----------------
-
|image0|
CDS UI:
-------
-
|image1|
-
|image2|
.. |image0| image:: media/Enrichment-REST.png
Workflow
========
-
A workflow defines an overall action to be taken on the service, hence is an entry-point for the run-time execution of the CBA package.
A workflow also defines inputs and outputs that will defined the payload contract of the request and response (see Dynamic API)
A CBA package can have as many workflows as needed.
+
Single action
-------------
-
The workflow is directly backed by a node_template of type tosca.nodes.Component
+
Multiple sub-actions
--------------------
The workflow is backed by Directed Graph engine, node_template of type dg-generic, and are imperative workflows.
Below the properties of a workflow:
-
Workflow Example
----------------
-
-::
+.. code-block:: json
{
"workflow": {
"required": true,
"type": "string"
},
- "resource-assignment-properties": { <- dynamic inputs
+ "resource-assignment-properties": { <- dynamic inputs
"required": true,
"type": "dt-resource-assignment-properties"
}
This node was created, derived from ``tosca.artifacts.Root`` to be the root TOSCA node for all artifact.
-.. code-block:: JSON
+.. code-block:: json
:caption: **tosca.artifacts.Implementation**
{
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-velocity.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-template-velocity**
{
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-template-jinja**
{
`Here <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/artifact_type/artifact-mapping-resource.json>`_
is the TOSCA artifact type:
- .. code-block:: JSON
+ .. code-block:: json
:caption: **artifact-mapping-resource**
{
:header-rows: 1
* - vf-module-label data dictionary
- * - .. code-block:: JSON
-
+ * - .. code-block:: json
{
"name" : "vf-module-label",
:caption: **Payload:**
{
- "model-name": "<model-name>",
- "derivedFrom": "tosca.datatypes.Root",
- "definitionType": "data_type",
- "definition": {
+ "model-name": "<model-name>",
+ "derivedFrom": "tosca.datatypes.Root",
+ "definitionType": "data_type",
+ "definition": {
"description": "<description>",
"version": "<version-number: eg 1.0.0>",
"properties": {<add properties of your custom data type in JSON format>},
"derived_from": "tosca.datatypes.Root"
- },
- "description": "<description",
- "version": "<version>",
- "tags": "<model-name>,datatypes.Root.data_type",
- "creationDate": "<creation timestamp>",
- "updatedBy": "<name>"
+ },
+ "description": "<description",
+ "version": "<version>",
+ "tags": "<model-name>,datatypes.Root.data_type",
+ "creationDate": "<creation timestamp>",
+ "updatedBy": "<name>"
}
Data type are useful to manipulate data during resource resolution.
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-resource-assignment.json>`_
- .. code-block:: JSON
+ .. code-block:: json
:caption: **datatype-resource-assignment**
{
`<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-property.json>`_
- .. code-block:: JSON
+ .. code-block:: json
:caption: **datatype-property**
{
"description": "This is Resource Assignment Data Type",
"properties": {
"property": {
- "required": true,
- "type": "datatype-property"
+ "required": true,
+ "type": "datatype-property"
},
"input-param": {
- "required": true,
- "type": "boolean"
+ "required": true,
+ "type": "boolean"
},
"dictionary-name": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"dictionary-source": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
},
"updated-date": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
},
"updated-by": {
- "required": false,
- "type": "string"
+ "required": false,
+ "type": "string"
}
},
"derived_from": "tosca.datatypes.Root"
Example for workflow named *resource-assignment*:
-.. code-block:: JSON
+.. code-block:: json
:caption: **dynamic input**
{
. . .
"dsl_definitions": {
"ipam-1": {
- "type": "basic-auth",
- "url": "http://localhost:8080",
- "username": "bob",
- "password": "marley"
+ "type": "basic-auth",
+ "url": "http://localhost:8080",
+ "username": "bob",
+ "password": "marley"
}
}
. . .
. . .
"dsl_definitions": {
"ipam-1": {
- "type" : "ssl-basic-auth",
- "url" : "http://localhost:32778",
- "keyStoreInstance": "JKS or PKCS12",
- "sslTrust": "trusture",
- "sslTrustPassword": "trustore password",
- "sslKey": "keystore",
- "sslKeyPassword: "keystore password"
+ "type" : "ssl-basic-auth",
+ "url" : "http://localhost:32778",
+ "keyStoreInstance": "JKS or PKCS12",
+ "sslTrust": "trusture",
+ "sslTrustPassword": "trustore password",
+ "sslKey": "keystore",
+ "sslKeyPassword: "keystore password"
}
}
. . .
. . .
"dsl_definitions": {
"netprog-db": {
- "type": "maria-db",
- "url": "jdbc:mysql://10.195.196.123:32050/netprog",
- "username": "netprog",
- "password": "netprog"
+ "type": "maria-db",
+ "url": "jdbc:mysql://10.195.196.123:32050/netprog",
+ "username": "netprog",
+ "password": "netprog"
}
}
. . .
.. code-block:: json
:caption: **component-script-executor**
- {
- "description": "This is Netconf Transaction Configuration Component API",
- "version": "1.0.0",
- "interfaces": {
- "ComponentScriptExecutor": {
+ {
+ "description": "This is Netconf Transaction Configuration Component API",
+ "version": "1.0.0",
+ "interfaces": {
+ "ComponentScriptExecutor": {
"operations": {
- "process": {
- "inputs": {
+ "process": {
+ "inputs": {
"script-type": {
- "description": "Script type, kotlin type is supported",
- "required": true,
- "type": "string",
- "default": "internal",
- "constraints": [
- {
+ "description": "Script type, kotlin type is supported",
+ "required": true,
+ "type": "string",
+ "default": "internal",
+ "constraints": [
+ {
"valid_values": [
- "kotlin",
- "jython",
- "internal"
+ "kotlin",
+ "jython",
+ "internal"
]
- }
- ]
+ }
+ ]
},
"script-class-reference": {
- "description": "Kotlin Script class name with full package or jython script name.",
- "required": true,
- "type": "string"
+ "description": "Kotlin Script class name with full package or jython script name.",
+ "required": true,
+ "type": "string"
},
"dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
+ "description": "Dynamic Json Content or DSL Json reference.",
+ "required": false,
+ "type": "json"
}
- },
- "outputs": {
+ },
+ "outputs": {
"response-data": {
- "description": "Execution Response Data in JSON format.",
- "required": false,
- "type": "string"
+ "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"
+ "description": "Status of the Component Execution ( success or failure )",
+ "required": true,
+ "type": "string"
}
- }
- }
+ }
+ }
}
- }
- },
- "derived_from": "tosca.nodes.Component"
- }
+ }
+ },
+ "derived_from": "tosca.nodes.Component"
+ }
.. tab:: remote-script-executor
:caption: **Example**
"packages": [
- {
- "type": "pip",
- "package": [
+ {
+ "type": "pip",
+ "package": [
"requirements.txt"
- ]
- },
- {
- "type": "ansible_galaxy",
- "package": [
+ ]
+ },
+ {
+ "type": "ansible_galaxy",
+ "package": [
"juniper.junos"
- ]
- }
+ ]
+ }
]
The `argument-properties` allows to specified input argument to the script to execute. They should be
:caption: **Example**
"ansible-argument-properties": {
- "arg0": "-i",
- "arg1": "Scripts/ansible/inventory.yaml",
- "arg2": "--extra-vars",
- "arg3": {
- "get_attribute": [
+ "arg0": "-i",
+ "arg1": "Scripts/ansible/inventory.yaml",
+ "arg2": "--extra-vars",
+ "arg3": {
+ "get_attribute": [
"resolve-ansible-vars",
"",
"assignment-params",
"ansible-vars"
- ]
- }
+ ]
+ }
}
The `dynamic-properties` can be anything that needs to be passed to the
**Bellow is a list of supported sources**
.. tabs::
+
.. tab:: input
**Input:**
xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='CONFIG' version='1.0.0'>
<method rpc='ConfigDeploy' mode='sync'>
<block atomic="true">
- <execute plugin="nf-account-collection" method="process">
- <outcome value='failure'>
- <return status="failure">
- </return>
- </outcome>
- <outcome value='success'>
- <execute plugin="execute" method="process">
- <outcome value='failure'>
- <return status="failure">
- </return>
- </outcome>
- <outcome value='success'>
- <return status='success'>
- </return>
- </outcome>
- </execute>
- </outcome>
- </execute>
+ <execute plugin="nf-account-collection" method="process">
+ <outcome value='failure'>
+ <return status="failure">
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <execute plugin="execute" method="process">
+ <outcome value='failure'>
+ <return status="failure">
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
</block>
</method>
</service-logic>
.. Copyright (C) 2019 IBM.
Resource Definition
--------------------
+===================
.. toctree::
:maxdepth: 2
Introduction:
-=============
+-------------
A Resource definition 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.
|image0|
-
Below 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.
Example:
-========
+--------
vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.
.. code-block:: json
:linenos:
- {
+ {
"description": "This is Component Resource Source Node Type",
"version": "1.0.0",
"properties": {
}
},
"derived_from": "tosca.nodes.ResourceSource"
- }
+ }
Resource source:
-================
+----------------
Defines the contract to resolve a resource.
.. Copyright (C) 2019 IBM.
Resource Source
----------------
+===============
.. toctree::
:maxdepth: 4
Input:
-======
+------
Expects the value to be provided as input to the request.
.. code-block:: json
}
Default:
-========
+--------
Expects the value to be defaulted in the model itself.
.. code-block:: json
}
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.
.. code-block:: json
:linenos:
- {
+ {
"description": "This is Database Resource Source Node Type",
"version": "1.0.0",
"properties": {
}
},
"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.
}
Rest:
-=====
+-----
Expects the URI along with the VERB and the payload, if needed.
.. code-block:: json
:linenos:
- {
+ {
"description": "This is Rest Resource Source Node Type",
"version": "1.0.0",
"properties": {
}
},
"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.
}
Capability:
-===========
+-----------
Expects a script to be provided.
.. code-block:: json
:linenos:
- {
+ {
"description": "This is Component Resource Source Node Type",
"version": "1.0.0",
"properties": {
}
},
"derived_from": "tosca.nodes.ResourceSource"
- }
+ }
Complex Type:
-=============
+-------------
Value will be resolved through REST., and output will be a complex type.
.. code-block:: json
:linenos:
- {
+ {
"id": 4,
"address": "192.168.10.2/32",
"vrf": null,
"nat_inside": null,
"created": "2018-08-30",
"last_updated": "2018-08-30T14:59:05.277820Z"
- }
+ }
What is of interest is the address and id fields. For the process to return these two values, we need to create a custom data-type, as bellow
CDS Designer UI
===============
-**Table of Contents**
-
-- `Getting
- Started <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-GettingStarted>`__
-
-- `What is CDS Designer
- UI? <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-WhatIsCDS>`__
-
-- `What's
- new? <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-WhatIsNew>`__
-
-- `Overview of CDS
- Interface <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-OverviewOfCDS>`__
-
-- `CBA
- Packages <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CBAPackages>`__
-
- - `Package
- list <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-PackageList>`__
-
- - `Create a CBA
- Package <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CreateNewCBAPackage>`__
-
- - `User
- Flow <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-UserFlow>`__
-
- - `Create a New
- Package <file:////pages/viewpage.action%3fpageId=84650427#CDSDesignerGuide-CreateNewPackage>`__
-
- - `MetaData <#CDSDesignerGuide-MetaData>`__
-
- - `Template & Mapping <#CDSDesignerGuide-TemplateMapping>`__
-
- - `Scripts <#CDSDesignerGuide-Scripts>`__
-
- - `Definitions <#CDSDesignerGuide-Definitions>`__
-
- - `External System Authentication
- Properties <#CDSDesignerGuide-ExternalSystem>`__
+.. toctree::
+ :caption: Table of Contents
+ :maxdepth: 4
Getting Started
what you want to achieve, it should cover everything you need to know —
from navigating the interface to making the most of different features.
+
What is CDS Designer UI?
------------------------
| standard**, using JSON as a representation. | |
+----------------------------------------------+--------------+
-.. _section-3:
What's new?
-----------
| | management) | |
+----------------------+----------------------+----------------------+
+
Overview of CDS Interface
-------------------------
4. **Module list:** View all active items in module and tools for search
and filtering
+
CBA Packages
------------
-- .. rubric:: Package List
- :name: package-list
+Package List
+~~~~~~~~~~~~
It gives you quick access to all and most recent created/edit packages
and Generic scripting) and by clicking on it, it will load to mode
screen
+
Create a New CBA Package
------------------------
-- .. rubric:: User Flow
- :name: user-flow
+User Flow
+~~~~~~~~~
|image10|
-- .. rubric:: Create a New Package
- :name: create-a-new-package
+
+Create a New Package
+~~~~~~~~~~~~~~~~~~~~
You can create a new CBA Package by creating a new custom package or by
import package file that is already created before.
|image11|
-- .. rubric:: `MetaData <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-958933373>`__
- :name: metadata
+
+`MetaData <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-958933373>`__
+~~~~~~~~~
In **MetaData Tab,** select Package Mode, enter package Name, Version,
Description and other configurations
navigate to the top left in breadcrumb and click the **CBA Packages**
link or click on **Packages** link in the Main menu.
-- .. rubric:: `Template &
- Mapping <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--1256902502>`__
- :name: template-mapping
+
+`Template & Mapping <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--1256902502>`__
+~~~~~~~~~~~~~~~~~~~
You can create as many templates using
`artifact-mapping-resource <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-artifact-mapping-resource>`__
|image22|
-- .. rubric:: `Scripts <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--703799064>`__
- :name: scripts
+
+`Scripts <https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts--703799064>`__
+~~~~~~~~
Allowed file type: Kotlin(kt), Python(py)
To add script file/s, you have two options:
-1. **Enter file URL:** Script file can be stored in server and you can
- add this script file by copy and paste file URL in URL input then
- **press ENTER** key from the keyboard
+**Enter file URL:** Script file can be stored in server and you can add this script file by copy and paste file URL in URL input then
+**press ENTER** key from the keyboard
|image23|
-2. **Import File**
+**Import File**
|image24|
|image25|
-- .. rubric:: `Definitions <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-dataType>`__
- :name: definitions
+
+`Definitions <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-dataType>`__
+~~~~~~~~~~~~
Allowed file type: JSON
To define a data type that represents the **schema** of a specific type
of **data**, you have two options:
-1. ** Enter file URL:** Definition file can be stored in server and user can
- add this script file by copy and paste file URL in URL input then
- **press ENTER** key from the keyboard
+**Enter file URL:** Definition file can be stored in server and user can add this script file by copy and paste file URL in URL input then
+**press ENTER** key from the keyboard
|image26|
-2. **Import File**
+**Import File**
|image27|
|image28|
-- .. rubric:: `External System Authentication
- Properties <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-FlexiblePlugIn>`__
- :name: external-system-authentication-properties
+
+`External System Authentication Properties <https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-FlexiblePlugIn>`__
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to populate the system information within the package, you have
to provide **dsl_definitions**
.. toctree::
:maxdepth: 2
- ../CBA/index
+ ../cba/index
../resourcedefinition/index
resourceassignment
npm install in the directory cds/cds-ui/client
npm run build - to build UI module
-
Loopback Server:
~~~~~~~~~~~~~~~~
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2019 IBM.
-Resource Assignment
--------------------
+Resource Assignment
+===================
.. toctree::
:maxdepth: 1
-
-
+
+
Component executor:
-===================
+-------------------
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.
A CBA can have as many workflow as needed.
Template:
-=========
+~~~~~~~~~
A template is an artifact.
A template can represent anything, such as device config, payload to interact with 3rd party systems, resource-accumulator template, etc...
Mapping:
-========
+~~~~~~~~
Defines the contract of each resource to be resolved. Each placeholder in the template must have a corresponding mapping definition.
A mapping is comprised of:
- dictionary-source
Dependencies:
-=============
+~~~~~~~~~~~~~
This allows to make sure given resources get resolved prior the resolution of the resources defining the dependency.
The dictionary fields reference to a specific data dictionary.
+
Resource accumulator:
-=====================
+---------------------
In order to resolve HEAT environment variables, resource accumulator templates are being in used for Dublin.
Have the blueprint processor running locally is to use the IDE to run the code, while having the database running in a container.
This way, code changes can be conveniently tested and debugged.
-
Check out the code
~~~~~~~~~~~~~~~~~~~
Navigate to the docker-compose file in the distribution module:
-.. tabs::
-
- .. group-tab:: Latest
-
- .. code-block:: bash
-
- cd ms/blueprintsprocessor/application/src/main/dc
-
- .. group-tab:: Frankfurt
-
- .. code-block:: bash
-
- cd ms/blueprintsprocessor/application/src/main/dc
-
- .. group-tab:: El Alto
-
- .. code-block:: bash
-
- ms/blueprintsprocessor/distribution/src/main/dc
-
- .. group-tab:: Dublin
-
- .. code-block:: bash
+.. code-block:: bash
- ms/blueprintsprocessor/distribution/src/main/dc
+ ms/blueprintsprocessor/distribution/src/main/dc
And run docker-composer:
docker start <id of mariadb container>
-
Set permissions on the local file system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|imageReimportMaven|
-
**Override some application properties:**
After the project is compiled, a Run Configuration profile overriding some application properties
.. code-block:: json
{
- "type": "kotlin",
- "request": "launch",
- "name": "Blueprint Processor",
- "projectRoot": "${workspaceFolder}/ms/blueprintsprocessor/application",
- "mainClass": "-Dspring.profiles.active=dev org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt"
+ "type": "kotlin",
+ "request": "launch",
+ "name": "Blueprint Processor",
+ "projectRoot": "${workspaceFolder}/ms/blueprintsprocessor/application",
+ "mainClass": "-Dspring.profiles.active=dev org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt"
}
.. warning:: The `projectRoot` path assumes that you created your Workspace in the main CDS repository folder. If not - please change the path accordingly
Testing the application
-~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~
There are two main features of the Blueprints Processor that can be of interest of a developer:
blueprint publish and blueprint process.
A detailed description of the usage of different APIs of CDS will follow.
+
Possible Fixes
-~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~
Imported packages or annotiations are not found, Run Config not available?
*****************************************************************************
3. Maven reimport in IDE
Compilation error?
-********************
+*******************
* Change Java Version to 11