blob: aa83920cb1f33c0f3f602ddad30f0deb685ae366 [file] [log] [blame]
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -04001.. 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
5Resource Definition
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -04006===================
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -04007.. toctree::
8 :maxdepth: 2
9
10Introduction:
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040011-------------
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040012A Resource definition models the how a specific resource can be resolved.
13
14A 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
16A Resource definition can have multiple sources to handle resolution in different ways. The main goal of Resource definition is to define re-usable entity that could be shared.
17
18Creation of Resource definition is a standalone activity, separated from the blueprint design.
19
20As part of modelling a Resource definition entry, the following generic information should be provided:
21
22|image0|
23
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040024Below are properties that all the resource source have will have
25
26The modeling does allow for data translation between external capability and CDS for both input and output key mapping.
27
28|image1|
29
30
31Example:
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040032--------
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040033
34vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.
35
36Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
37
38.. code-block:: json
39 :linenos:
40
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040041 {
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040042 "description": "This is Component Resource Source Node Type",
43 "version": "1.0.0",
44 "properties": {
45 "script-type": {
46 "required": true,
47 "type": "string",
48 "default": "kotlin",
49 "constraints": [
50 {
51 "valid_values": [
52 "kotlin",
53 "jython"
54 ]
55 }
56 ]
57 },
58 "script-class-reference": {
59 "description": "Capability reference name for internal and kotlin, for jython script file path",
60 "required": true,
61 "type": "string"
62 },
63 "instance-dependencies": {
64 "required": false,
65 "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
66 "type": "list",
67 "entry_schema": {
68 "type": "string"
69 }
70 },
71 "key-dependencies": {
72 "description": "Resource Resolution dependency dictionary names.",
73 "required": true,
74 "type": "list",
75 "entry_schema": {
76 "type": "string"
77 }
78 }
79 },
80 "derived_from": "tosca.nodes.ResourceSource"
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040081 }
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040082
83
84Resource source:
Singal, Kapil (ks220y)51e7c122020-09-25 17:22:54 -040085----------------
Singal, Kapil (ks220y)f1aafc42020-09-24 12:47:56 -040086
87Defines the contract to resolve a resource.
88
89A resource source is modeled, following TOSCA_ node type definition and derives from the Resource_ source.
90
91Also please click below for resource source available details
92
93.. toctree::
94 :maxdepth: 4
95
96 resourcesource
97
98.. _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
99.. _Resource: https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-NodeResourceSource
100
101
102.. |image0| image:: media/mandatory.JPG
103 :width: 400pt
104
105.. |image1| image:: media/optional.JPG
106 :width: 400pt