JakobKrieg | f2d67d6 | 2020-08-17 22:36:44 +0200 | [diff] [blame] | 1 | .. 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 |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 4 | .. Copyright (C) 2020 Deutsche Telekom AG. |
| 5 | |
| 6 | .. _data_dictionary: |
| 7 | |
| 8 | Data Dictionary |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 9 | --------------- |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 10 | |
| 11 | A data dictionary **models the how** a specific **resource** can be **resolved**. |
| 12 | |
| 13 | A resource is a **variable/parameter** in the context of the service. |
| 14 | It can be anything, but it should not be confused with SDC or Openstack resources. |
| 15 | |
| 16 | A data dictionary can have **multiple sources** to handle resolution in different ways. |
| 17 | |
| 18 | The 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 | |
| 22 | As 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) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 35 | - Information related |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 36 | - 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) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 45 | - Mandatory |
| 46 | |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 47 | **Bellow are properties that all the resource source can have** |
| 48 | |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 49 | The modeling does allow for **data translation** between external capability |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 50 | and 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) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 60 | - map of resources required to perform the request/query. The left hand-side is what is used within |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 61 | the query/request, the right hand side refer to a data dictionary instance. |
| 62 | - Optional |
| 63 | * - output-key-mapping |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 64 | - name of the resource to be resolved mapped to the value resolved by the request/query. |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 65 | - Optional |
| 66 | * - key-dependencies |
| 67 | - | list of data dictionary instances to be resolved prior the resolution of this specific resource. |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 68 | | during run time execution the key dependencies are recursively sorted and resolved |
| 69 | in batch processing using the `acyclic graph algorithm |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 70 | <https://en.wikipedia.org/wiki/Directed_acyclic_graph>`_ |
| 71 | - Optional |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 72 | |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 73 | **Example:** |
| 74 | |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 75 | ``vf-module-model-customization-uuid`` and ``vf-module-label`` are two data dictionaries. |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 76 | A SQL table, VF_MODULE_MODEL, exist to correlate them. |
| 77 | |
| 78 | Here 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) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 85 | * - .. code-block:: json |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 86 | |
| 87 | { |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 88 | "name" : "vf-module-label", |
| 89 | "tags" : "vf-module-label", |
| 90 | "updated-by" : "adetalhouet", |
| 91 | "property" : { |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 92 | "description" : "vf-module-label", |
| 93 | "type" : "string" |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 94 | }, |
| 95 | "sources" : { |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 96 | "primary-db" : { |
| 97 | "type" : "source-primary-db", |
| 98 | "properties" : { |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 99 | "type" : "SQL", |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 100 | "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", |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 101 | "input-key-mapping" : { |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 102 | "customizationid" : "vf-module-model-customization-uuid" |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 103 | }, |
| 104 | "output-key-mapping" : { |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 105 | "vf-module-label" : "vf_module_label" |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 106 | }, |
| 107 | "key-dependencies" : [ "vf-module-model-customization-uuid" ] |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 108 | } |
| 109 | } |
JakobKrieg | 7c3f395 | 2020-08-04 20:46:50 +0200 | [diff] [blame] | 110 | } |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 111 | } |