554517a7e0ce66494f3624b5e95aa3d4e9937e4d
[ccsdk/cds.git] / docs / modelingconcepts / enrichment.rst
1 .. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts
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.
5
6 .. _enrichment:
7
8 Enrichment
9 ----------
10
11 The idea is that the CBA is a self-sufficient package, hence requires
12 all the various types definition its using.
13
14 Reason for this is the types its using might evolve. In order for the
15 CBA to be bounded to the version it has been using when it has been
16 designed, these types are embedded in the CBA, so if they change, the
17 CBA is not affected.
18
19 The enrichment process will complete the package by providing all the
20 definition of types used:
21
22 * gather all the node-type used and put them into a :file:`node_types.json` file
23 * gather all the data-type used and put them into a :file:`data_types.json` file
24 * gather all the artifact-type used and put them into a :file:`artifact_types.json` file
25 * gather all the data dictionary definitions used from within the mapping files and put them
26   into a :file:`resources_definition_types.json` file
27
28 .. warning::
29    Before uploading a CBA, it must be enriched. If your package is already enrich,
30    you do not need to perform enrichment again.
31
32 The enrichment can be run using REST API, and required the **.zip** file as input.
33 It will return an :file:`enriched-cba.zip` file.
34
35 .. code-block:: bash
36
37    curl -X POST \
38       'http://{{ip}}:{{cds-designtime}}/api/v1/blueprint-model/enrich' \
39       -H 'content-type: multipart/form-data' \
40       -F file=@cba.zip
41
42 The enrichment process will also, for all resources to be resolved as input and default:
43
44 * dynamically gather them under a data-type, named ``dt-${actionName}-properties``
45 * will add it as a input of the workflow, as follow using this name: ``${actionName}-properties``
46
47 Example for workflow named *resource-assignment*:
48
49 .. code-block:: JSON
50    :caption: **dynamic input**
51
52    {
53      "resource-assignment-properties": {
54      "required": true,
55      "type": "dt-resource-assignment-properties"
56    }