blob: bfc86d0c90dd42c7d55118ead9bcd9bf109deaf5 [file] [log] [blame]
JakobKriegf2d67d62020-08-17 22:36:44 +02001.. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-1386016968
2.. This work is licensed under a Creative Commons Attribution 4.0
3.. International License. http://creativecommons.org/licenses/by/4.0
JakobKrieg7c3f3952020-08-04 20:46:50 +02004.. Copyright (C) 2020 Deutsche Telekom AG.
5
6.. _data_dictionary:
7
8Data Dictionary
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -04009---------------
JakobKrieg7c3f3952020-08-04 20:46:50 +020010
11A data dictionary **models the how** a specific **resource** can be **resolved**.
12
13A resource is a **variable/parameter** in the context of the service.
14It can be anything, but it should not be confused with SDC or Openstack resources.
15
16A data dictionary can have **multiple sources** to handle resolution in different ways.
17
18The main goal of data dictionary is to define **re-usable** entity that could be shared.
19
20**Creation** of data dictionaries is a **standalone** activity, separated from the blueprint design.
21
22As part of modelling a data dictionary entry, the following generic information should be provided:
23
24.. list-table::
25 :widths: 25 50 25
26 :header-rows: 1
27
28 * - Property
29 - Description
30 - Scope
31 * - updated-by
32 - The creator
33 - Mandatory
34 * - tags
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040035 - Information related
JakobKrieg7c3f3952020-08-04 20:46:50 +020036 - Mandatory
37 * - sources
38 - List of resource source instance (see :ref:`resource source`)
39 - Mandatory
40 * - property
41 - Defines type and description, as nested JSON
42 - Mandatory
43 * - name
44 - Data dictionary name
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040045 - Mandatory
46
JakobKrieg7c3f3952020-08-04 20:46:50 +020047**Bellow are properties that all the resource source can have**
48
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040049The modeling does allow for **data translation** between external capability
JakobKrieg7c3f3952020-08-04 20:46:50 +020050and CDS for both input and output key mapping.
51
52.. list-table::
53 :widths: 25 50 25
54 :header-rows: 1
55
56 * - Property
57 - Description
58 - Scope
59 * - input-key-mapping
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040060 - map of resources required to perform the request/query. The left hand-side is what is used within
JakobKrieg7c3f3952020-08-04 20:46:50 +020061 the query/request, the right hand side refer to a data dictionary instance.
62 - Optional
63 * - output-key-mapping
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040064 - name of the resource to be resolved mapped to the value resolved by the request/query.
JakobKrieg7c3f3952020-08-04 20:46:50 +020065 - Optional
66 * - key-dependencies
67 - | list of data dictionary instances to be resolved prior the resolution of this specific resource.
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040068 | during run time execution the key dependencies are recursively sorted and resolved
69 in batch processing using the `acyclic graph algorithm
JakobKrieg7c3f3952020-08-04 20:46:50 +020070 <https://en.wikipedia.org/wiki/Directed_acyclic_graph>`_
71 - Optional
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040072
JakobKrieg7c3f3952020-08-04 20:46:50 +020073**Example:**
74
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040075``vf-module-model-customization-uuid`` and ``vf-module-label`` are two data dictionaries.
JakobKrieg7c3f3952020-08-04 20:46:50 +020076A SQL table, VF_MODULE_MODEL, exist to correlate them.
77
78Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
79
80.. list-table::
81 :widths: 100
82 :header-rows: 1
83
84 * - vf-module-label data dictionary
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040085 * - .. code-block:: json
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040086
87 {
JakobKrieg7c3f3952020-08-04 20:46:50 +020088 "name" : "vf-module-label",
89 "tags" : "vf-module-label",
90 "updated-by" : "adetalhouet",
91 "property" : {
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040092 "description" : "vf-module-label",
93 "type" : "string"
JakobKrieg7c3f3952020-08-04 20:46:50 +020094 },
95 "sources" : {
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040096 "primary-db" : {
97 "type" : "source-primary-db",
98 "properties" : {
JakobKrieg7c3f3952020-08-04 20:46:50 +020099 "type" : "SQL",
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -0400100 "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",
JakobKrieg7c3f3952020-08-04 20:46:50 +0200101 "input-key-mapping" : {
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -0400102 "customizationid" : "vf-module-model-customization-uuid"
JakobKrieg7c3f3952020-08-04 20:46:50 +0200103 },
104 "output-key-mapping" : {
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -0400105 "vf-module-label" : "vf_module_label"
JakobKrieg7c3f3952020-08-04 20:46:50 +0200106 },
107 "key-dependencies" : [ "vf-module-model-customization-uuid" ]
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -0400108 }
109 }
JakobKrieg7c3f3952020-08-04 20:46:50 +0200110 }
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -0400111 }