a7e78564fbfe9c2fd60e4ae2d9b0f6624a4e00cb
[ccsdk/cds.git] / docs / datadictionary / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (C) 2019 IBM.
4
5 Resource Definition 
6 -------------------
7 .. toctree::
8    :maxdepth: 1
9
10 Introduction:
11 =============
12 A data dictionary models the how a specific resource can be resolved.
13
14 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.
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
23 As part of modelling a data dictionary entry, the following generic information should be provided:
24
25 |image0|
26
27 .. |image0| image:: media/image0.jpg
28    :width: 7.88889in 
29    :height: 4.43750in
30
31 Bellow are properties that all the resource source have will have
32
33 The modeling does allow for data translation between external capability and CDS for both input and output key mapping.
34
35 |image1|
36
37 .. |image1| image:: media/image0.jpg
38    :width: 7.88889in 
39    :height: 4.43750in
40
41 Example:
42 ========
43
44 vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.
45
46 Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
47
48 vf-module-label data dictionary  
49
50 {
51   "name" : "vf-module-label",
52   "tags" : "vf-module-label",
53   "updated-by" : "adetalhouet",
54   "property" : {
55     "description" : "vf-module-label",
56     "type" : "string"
57   },
58   "sources" : {
59     "primary-db" : {
60       "type" : "source-primary-db",
61       "properties" : {
62         "type" : "SQL",
63         "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",
64         "input-key-mapping" : {
65           "customizationid" : "vf-module-model-customization-uuid"
66         },
67         "output-key-mapping" : {
68           "vf-module-label" : "vf_module_label"
69         },
70         "key-dependencies" : [ "vf-module-model-customization-uuid" ]
71       }
72     }
73   }
74 }
75
76
77 Resource source:
78 ================
79
80 Defines the contract to resolve a resource.
81
82 A resource source is modeled, following http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd01/TOSCA-Simple-Profile-YAML-v1.0-csprd01.html#DEFN_ENTITY_NODE_TYPE, and derives from the https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-NodeResourceSource