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

Compare with Current View Page History

« Previous Version 101 Next »

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 a catalog of reusable data dictionary and component, delivering a reusable and simplified self service experience.

TOSCA based JSON format 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: https://github.com/onap/ccsdk-cds/tree/master/components/model-catalog/definition-type/starter-type



    Controller Blueprint Archive (.cba)

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

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

    ├── Definitions
    │   ├── blueprint.json							Overall TOSCA service template (worfklow + node_template)
    │   ├── artifact_types.json 					(generated by enrichment)
    │   ├── data_types.json 						(generated by enrichment)
    │   ├── node_types.json 						(generated by enrichment)
    │   ├── relationship_types.json 				(generated by enrichment)
    │   └── resources_definition_types.json 		(generated by enrichment)
    ├── Environments								Contains *.properties files as required by the service
    ├── Plans										Contains Directed Graph
    ├── Scripts										Contains scripts
    │   ├── python					 				Python scripts
    │   └── kotlin									Kotlin scripts
    ├── TOSCA-Metadata
    │   └── TOSCA.meta								Meta-data of overall package
    └── Templates									Contains combination of mapping and template

    Dynamic payload

    The nature of the API request and response is meant to be model driven and dynamic.

    The actionName, under the actionIdentifiers refers to the name of a Workflow (see workflow)

    The content of the payload is what is fully dynamic / model driven.

    The first top level element will always be either $actionName-request for a request or $actionName-response for a response.

    Then the content within this element is fully based on the workflow inputs and outputs.

    During the Enrichment, CDS will aggregate all the resources defined to be resolved as input, within mapping definition files, as data-type, that will then be use as type of an input called $actionName-properties.

    Here is how the a generic request and response look like.

    request
    {
      "commonHeader": {
        "originatorId": "",
        "requestId": "",
        "subRequestId": ""
      },
      "actionIdentifiers": {
        "blueprintName": "",
        "blueprintVersion": "",
        "actionName": "",
        "mode": ""
      },
      "payload": {
         "$actionName-request": {
            "$actionName-properties": {
            }
         }
      }
    }
    response
    {
      "commonHeader": {
        "originatorId": "",
        "requestId": "",
        "subRequestId": ""
      },
      "actionIdentifiers": {
        "blueprintName": "",
        "blueprintVersion": "",
        "actionName": "",
        "mode": ""
      },
      "payload": {
         "$actionName-response": {
         }
      }
    }

    Enrichment

    The enrichment process will complete the package by providing all the definition of types used:

    • gather all the node-type used and put them into a node_types.json file
    • gather all the data-type used and put them into a data_types.json file
    • gather all the artifact-type used and put them into a artifact_types.json file
    • gather all the resource definitions used and put them into a resources_definition_types.json file

    The enrichment can be run using REST API, and required the .zip file as input. It will return an enriched-cba.zip file.

    curl -X POST \
      'http://{{ip}}:{{cds-designtime}}/api/v1/blueprint-model/enrich' \
      -H 'content-type: multipart/form-data' \
      -F file=@cba.zip

    Flexible Endpoint

    Interaction with external systems is made dynamic, removing development cycle to support new endpoint.

    In order to define the external system information, TOSCA provides dsl_definitions. Link to TOSCA spec info 1, info 2.

    Use cases:

    • Resource resolution using REST or SQL external systems
    • gRPC is supported for remote execution
    • Any REST endpoint can be dynamically injected as part of the scripting framework.


    Here are some examples on how to populate the system information within the package:

    token-auth
    {
      . . .
      "dsl_definitions": {
        "ipam-1": {
          "type": "token-auth",
          "url": "http://netbox-nginx.netprog:8080",
          "token": "Token 0123456789abcdef0123456789abcdef01234567"
        }
      }
      . . .
    }
    basic-auth
    {
      . . .
      "dsl_definitions": {
        "ipam-1": {
          "type": "basic-auth",
          "url": "http://localhost:8080",
          "username": "bob",
          "password": "marley"
        }
      }
      . . .
    }
    ssl-basic-auth
    {
      . . .
      "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"
        }
      }
      . . .
    }
    grpc-executor
    {
      . . .
      "dsl_definitions": {
       "remote-executor": {
         "type": "token-auth",
         "host": "cds-command-executor.netprog",
         "port": "50051",
         "token": "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=="
       },
      }
      . . .
    }
    maria-db
    {
      . . .
      "dsl_definitions": {
        "netprog-db": {
          "type": "maria-db",
          "url": "jdbc:mysql://10.195.196.123:32050/netprog",
          "username": "netprog",
          "password": "netprog"
        }
      }
      . . .
    }

    Expression

    TOSCA provides for a set of functions to reference elements within the template or to retrieve runtime values.


    Below is a list of supported expressions


      get_input

      The get_input function is used to retrieve the values of properties declared within the inputs section of a TOSCA Service Template.

      Within CDS, this is mainly Workflow inputs.

      TOSCA specification

      Example:

      https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L210

      "resolution-key": {
        "get_input": "resolution-key"
      }

      get_property

      The get_property function is used to retrieve property values between modelable entities defined in the same service template.

      TOSCA specification

      Example

      TBD

      get_attribute

      The get_attribute function is used to retrieve the values of named attributes declared by the referenced node or relationship template name.

      TOSCA specification

      Example:

      https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L64-L67

      "get_attribute": [
        "resource-assignment",
        "assignment-params"
      ]

      get_operation_output

      The get_operation_output function is used to retrieve the values of variables exposed / exported from an interface operation.

      TOSCA specification

      Example

      TBD

      get_artifact

      The get_artifact function is used to retrieve artifact location between modelable entities defined in the same service template.

      TOSCA specification

      Example

      TBD

      Data type

      Represents the schema of a specific type of data.

      Supports both primitive and complex data types:

      Primitive Complex
      • string
      • integer
      • float
      • double
      • boolean
      • timestamp
      • null
      • json
      • list
      • array

      For complex data type, an entry schema is required, defining the type of value contained within the complex type, if list or array.

      Users can create as many data type as needed.

      Data type are useful to manipulate data during resource resolution. They can be used to format the JSON output as needed.

      List of existing data type: https://github.com/onap/ccsdk-cds/tree/master/components/model-catalog/definition-type/starter-type/data_type

      TOSCA specification


      Bellow is a list of existing data types

        datatype-resource-assignment

        Used to define entries within artifact-mapping-resource

        That datatype represent a resource to be resolved. We also refer this as an instance of a data dictionary as it's directly linked to its definition.

        Property Description
        property Defines how the resource looks like (see datatype-property)
        input-param Whether the resource can be provided as input.
        dictionary-name Reference to the name of the data dictionary (see Data Dictionary).
        dictionary-source Reference the source to use to resolve the resource (see Resource source).
        dependencies List of dependencies required to resolve this resource.
        updated-date Date when mapping was upload.
        updated-by Name of the person that updated the mapping.

        https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-resource-assignment.json

        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"
        }

        datatype-property

        Used to defined the property entry of a resource assignment.

        Property Description
        type Whether it's a primitive type, or a defined data-type
        description Description of for the property
        required Whether it's required or not
        default If there is a default value to provide
        entry_schema If the type is a complex one, such as list, define what is the type of element within the list.

        https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/data_type/datatype-property.json

        datatype-property
        {
          "version": "1.0.0",
          "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
          "properties": {
            "type": {
              "required": true,
              "type": "string"
            },
            "description": {
              "required": false,
              "type": "string"
            },
            "required": {
              "required": false,
              "type": "boolean"
            },
            "default": {
              "required": false,
              "type": "string"
            },
            "entry_schema": {
              "required": false,
              "type": "string"
            }
          },
          "derived_from": "tosca.datatypes.Root"
        }


        Artifact Type

        Represents the type of a artifact, used to identify the implementation of the functionality supporting this type of artifact.

        TOSCA definition

        This node was created, derived from tosca.artifacts.Root to be the root TOSCA node for all artifact.

        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-template-velocity

          Represents an Apache Velocity template.

          Apache Velocity allow to insert logic (if / else / loops / etc) when processing the output of a template/text.

          File must have .vtl extension.

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

          Often a template will be parameterized, and each parameter must be defined within an mapping file.

          Velocity reference document

          Here is the TOSCA artifact type:

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

          artifact-mapping-resource

          This type is meant to represent mapping files defining the contract of each resource to be resolved.

          Each parameter in a template must have a corresponding mapping definition, modeled using datatype-resource-assignment.

          Hence the mapping file is meant to be a list of entries defined using datatype-resource-assignment.

          File must have .json extension.

          Here is the TOSCA artifact type:

          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-directed-graph

          Represents a directed graph.

          This is to represent a workflow.

          File must have .xml extension.

          Here is the list of executors currently supported (see here for explanation and full potential list: Service Logic Interpreter Nodes)

          • execute
          • block
          • return
          • break
          • exit

          Here is the TOSCA artifact type:

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

          Node type

          TOSCA definition

          In CDS, we have mainly two distinct types

            Used to represent a functionality along with its contract, such as inputs, ouputs, and attributes

            Here is the root component TOSCA node type from which other node type will derive:

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

            Bellow is a list of supported components

              component-resource-resolution

              Used to perform resolution of resources.

              Requires as many as artifact-mapping-resource AND artifact-template-velocity or artifact-template-jinja as needed.

              Will put the resolution result as an attribute in the workflow context called assignment-params.

              Using the get_attribute expression, this attribute can be retrieve to be provided as workflow output (see Workflow).


              To store each resource being resolved, along with their status, and the meshed template, `store-result` should be set to `true`


              Here is the definition:

              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"
                          },
                          "occurrence": {
                            "description": "Number of time to perform the resolution.",
                            "required": false,
                            "default": 1,
                            "type": "integer"
                          },
                          "store-result": {
                            "description": "Whether or not to store the output.",
                            "required": false,
                            "type": "boolean"
                          },
                          "resource-type": {
                            "description": "Request type.",
                            "required": false,
                            "type": "string"
                          },
                          "artifact-prefix-names": {
                            "required": true,
                            "description": "Template , Resource Assignment Artifact Prefix names",
                            "type": "list",
                            "entry_schema": {
                              "type": "string"
                            }
                          },
                          "request-id": {
                            "description": "Request Id, Unique Id for the request.",
                            "required": true,
                            "type": "string"
                          },
                          "resource-id": {
                            "description": "Resource Id.",
                            "required": false,
                            "type": "string"
                          },
                          "action-name": {
                            "description": "Action Name of the process",
                            "required": false,
                            "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-script-executor

              Used to execute NETCONF, RESTCONF, SSH commands through a script.

              Used to execute python scripts through Java, or Kotlin script.

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

              https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-script-executor.json

              component-netconf-executor
              {
                "description": "This is Netconf Transaction Configuration Component API",
                "version": "1.0.0", 
                "interfaces": {
                  "ComponentScriptExecutor": {
                    "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"
                          },            
                          "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"
              }

              Used to represent a type of source to resolve a resource, along with the expected properties



              Bellow is a list of supported node types

                tosca.nodes.VNF

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

                https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Vnf.json

                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.

                https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/vnf-netconf-device.json

                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.

                https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.ResourceSource.json

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

                dg-generic

                Identifies a Directed Graph used as imperative workflow.

                https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/dg-generic.json

                dg-generic
                {
                  "description": "This is Generic Directed Graph Type",
                  "version": "1.0.0",
                  "properties": {
                    "content": {
                      "required": true,
                      "type": "string"
                    },
                    "dependency-node-templates": {
                      "required": true,
                      "description": "Dependent Step Components NodeTemplate name.",
                      "type": "list",
                      "entry_schema": {
                        "type": "string"
                      }
                    }
                  },
                  "derived_from": "tosca.nodes.DG"
                }

                tosca.nodes.Component

                This is the root level for all component functionalities, represents a functionality.

                https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.Component.json

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


                Bellow is a list of supported components

                  component-jython-executor

                  Used to execute python scripts through Java.

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

                  https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json

                  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-resource-resolution

                  Used to perform resolution of resources.

                  Makes use of artifact-mapping-resource and artifact-template-velocity

                  Will store to resolution result as an attribute in the workflow context call assignment-params. Using the get_attribute expression, this attribute can be retrieve to be provide as workflow output (see Workflow).

                  https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-resource-resolution.json

                  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-script-executor

                  Used to execute NETCONF, RESTCONF, SSH commands through a script.

                  https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/definition-type/starter-type/node_type/component-script-executor.json

                  component-netconf-executor
                  {
                    "description": "This is Netconf Transaction Configuration Component API",
                    "version": "1.0.0", 
                    "interfaces": {
                      "ComponentScriptExecutor": {
                        "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"
                              },            
                              "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


                  Workflow Scope within CDS Framework

                  The workflow is within the scope of the micro provisioning and configuration management in controller domain and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project. 


                  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 workflow can be composed of one or multiple sub-actions to execute.

                  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 a Directed Graph engine, node_template of type dg-generic, and are imperative workflows.

                  A DG used as workflow for CDS is composed of multiple execute nodes; each individual execute node refers to a plugin, that is a node_template of type tosca.nodes.Component.

                  Properties of a workflow

                  Property Description
                  workflow-name Defines the name of the action that can be triggered by external system
                  inputs

                  They are two types of inputs, the dynamic ones, and the static one.

                    Specified at workflow level

                    • represent inputs for a tosca.nodes.Component, see the inputs section of the component of interest.
                    • represent inputs to derived custom logic within scripting

                    These will end up under ${workflow-name}-request section of the payload (see Dynamic API)

                    Represent the resources defined as input within mapping definition files.

                    The enrichment process will

                    • dynamically gather all of them under a data-type, named dt-${workflow-name}-properties
                    • will add it as a input of the workflow, as follow using this name: ${workflow-name}-properties

                    Example for workflow named resource-assignment:

                    dynamic input
                      "resource-assignment-properties": {
                        "required": true,
                        "type": "dt-resource-assignment-properties"
                      }

                    outputs

                    Defines the outputs of the execution; there can be as many output as needed.

                    type value
                    data type (complex / primitive) value resolvable using expression

                    steps

                    Defines the actual step to execute as part of the workflow

                    step-name description target
                    name of the step step description a node_template (see single action or multiple action)


                    Example:

                    workflow example
                    {
                      "workflow": {
                        "resource-assignment": {								<- workflow-name
                          "inputs": {
                            "vnf-id": {											<- static inputs
                              "required": true,
                              "type": "string"
                            },
                            "resource-assignment-properties": {					<- dynamic inputs
                              "required": true,
                              "type": "dt-resource-assignment-properties"
                            }
                          },
                          "steps": {
                            "call-resource-assignment": {						<- step-name
                              "description": "Resource Assignment Workflow",
                              "target": "resource-assignment-process"			<- node_template targeted by the step
                            }
                          },
                          "outputs": {
                            "template-properties": {							<- output
                              "type": "json",									<- complex type
                              "value": {
                                "get_attribute": [								<- uses expression to retrieve attribute from context
                                  "resource-assignment",
                                  "assignment-params"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }


                    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 artifact-mapping-resource 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 correlates to which template, the file name must start with an artifact-prefix, serving as identifier to the overall template + mapping.

                    The requirement is as follows:

                    ${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 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-cds/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-cds/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 design.

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

                    Property Description Scope
                    name Data dictionary name Mandatory
                    tags Information related Mandatory
                    updated-by The creator Mandatory
                    property Defines type and description, as nested JSON Mandatory
                    sources List of resource source instance (see resource source) Mandatory

                    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.

                    Property Description Scope
                    input-key-mapping map 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-mapping name 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" ]
                          }
                        }
                      }
                    }

                    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.ResourceSource


                      Input

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

                      https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/node_types.json#L221

                      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.

                      https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/node_types.json#L203

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

                      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.

                      https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/node_types.json#L282

                      Property Description Scope
                      type Expected output value, only JSON supported for now Optional
                      verb HTTP verb for the request - default value is GET Optional
                      payload
                      Optional
                      endpoint-selector Specify which REST system to connect to Optional

                      url-path

                      URI Mandatory
                      path JSON path to the value to fetch from the response Mandatory

                      expression-type

                      Path expression type - default value is JSON_PATH Optional
                      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"
                         }
                        }

                      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.

                      https://github.com/onap/ccsdk-cds/blob/ffb6bdfd6de2afa23d95d0884c9db4059982deed/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/node_types.json#L239

                      Property Description Scope
                      type Database type, only SQL supported for now Mandatory
                      endpoint-selector Specify which database to connect to Optional
                      query Statement to execute Mandatory
                      source-processor-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"
                        }
                      }

                      Capability

                      Expects a script to be provided.

                      https://github.com/onap/ccsdk-cds/blob/ffb6bdfd6de2afa23d95d0884c9db4059982deed/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/node_types.json#L167

                      Property Description Scope
                      script-type The type of the script - default value is Koltin Optional

                      script-class-reference

                      The name of the class to use to create an instance of the script Mandatory
                      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": [
                      			"internal",
                                  "kotlin",
                                  "jython"
                                ]
                              }
                            ]
                          },
                          "script-class-reference": {
                            "description": "Capability reference name for internal and kotlin, for jython script file path",
                            "required": true,
                            "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