blob: 24050000e6bd3c070687fe4b6b1c86479f54ef93 [file] [log] [blame]
Ezhilarasi68f9fea2019-03-08 19:32:42 +05301.. 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
Ezhilarasid01a3ee2019-03-20 20:57:04 +05305Resource Definition
6-------------------
Ezhilarasi68f9fea2019-03-08 19:32:42 +05307.. toctree::
8 :maxdepth: 1
9
10Introduction:
11=============
Ezhilarasi12ee0602019-04-17 18:01:14 +053012A Resource definition models the how a specific resource can be resolved.
Ezhilarasi68f9fea2019-03-08 19:32:42 +053013
Ezhilarasife6afae2019-04-15 19:55:07 +053014A 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.
Ezhilarasi68f9fea2019-03-08 19:32:42 +053015
Ezhilarasi12ee0602019-04-17 18:01:14 +053016A Resource definition can have multiple sources to handle resolution in different ways.
Ezhilarasife6afae2019-04-15 19:55:07 +053017
Ezhilarasi12ee0602019-04-17 18:01:14 +053018The main goal of Resource definition is to define re-usable entity that could be shared.
Ezhilarasife6afae2019-04-15 19:55:07 +053019
20Creation of data dictionaries is a standalone activity, separated from the blueprint design.
Ezhilarasi68f9fea2019-03-08 19:32:42 +053021
22
Ezhilarasi12ee0602019-04-17 18:01:14 +053023As part of modelling a Resource definition entry, the following generic information should be provided:
Ezhilarasi68f9fea2019-03-08 19:32:42 +053024
Ezhilarasife6afae2019-04-15 19:55:07 +053025|image0|
Ezhilarasi68f9fea2019-03-08 19:32:42 +053026
Ezhilarasi12ee0602019-04-17 18:01:14 +053027.. |image0| image:: image0.jpg
Ezhilarasife6afae2019-04-15 19:55:07 +053028 :width: 7.88889in
29 :height: 4.43750in
Ezhilarasi68f9fea2019-03-08 19:32:42 +053030
Ezhilarasife6afae2019-04-15 19:55:07 +053031Bellow are properties that all the resource source have will have
Ezhilarasi68f9fea2019-03-08 19:32:42 +053032
Ezhilarasife6afae2019-04-15 19:55:07 +053033The modeling does allow for data translation between external capability and CDS for both input and output key mapping.
Ezhilarasi68f9fea2019-03-08 19:32:42 +053034
Ezhilarasife6afae2019-04-15 19:55:07 +053035|image1|
36
Ezhilarasi12ee0602019-04-17 18:01:14 +053037.. |image1| image:: image1.jpg
Ezhilarasife6afae2019-04-15 19:55:07 +053038 :width: 7.88889in
39 :height: 4.43750in
40
41Example:
42========
43
44vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.
45
46Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
47
Ezhilarasi12ee0602019-04-17 18:01:14 +053048vf-module-label Resource definition
Ezhilarasife6afae2019-04-15 19:55:07 +053049
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
77Resource source:
78================
79
80Defines the contract to resolve a resource.
81
Ezhilarasi12ee0602019-04-17 18:01:14 +053082A resource source is modeled, following TOSCA_ node type definition and derives from the Resource_ source.
83
84Also please click below for detailed resource source details
85
86.. toctree::
87 :maxdepth: 1
88
89 resourcesource
90
91.. _TOSCA: 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
92.. _Resource_: https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-NodeResourceSource