Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 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 | |
Ezhilarasi | d01a3ee | 2019-03-20 20:57:04 +0530 | [diff] [blame] | 5 | Resource Definition |
| 6 | ------------------- |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 7 | .. toctree:: |
| 8 | :maxdepth: 1 |
| 9 | |
| 10 | Introduction: |
| 11 | ============= |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 12 | A Resource definition models the how a specific resource can be resolved. |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 13 | |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 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. |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 15 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 16 | A Resource definition can have multiple sources to handle resolution in different ways. |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 17 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 18 | The main goal of Resource definition is to define re-usable entity that could be shared. |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 19 | |
| 20 | Creation of data dictionaries is a standalone activity, separated from the blueprint design. |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 21 | |
| 22 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 23 | As part of modelling a Resource definition entry, the following generic information should be provided: |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 24 | |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 25 | |image0| |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 26 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 27 | .. |image0| image:: image0.jpg |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 28 | :width: 7.88889in |
| 29 | :height: 4.43750in |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 30 | |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 31 | Bellow are properties that all the resource source have will have |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 32 | |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 33 | The modeling does allow for data translation between external capability and CDS for both input and output key mapping. |
Ezhilarasi | 68f9fea | 2019-03-08 19:32:42 +0530 | [diff] [blame] | 34 | |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 35 | |image1| |
| 36 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 37 | .. |image1| image:: image1.jpg |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 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 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 48 | vf-module-label Resource definition |
Ezhilarasi | fe6afae | 2019-04-15 19:55:07 +0530 | [diff] [blame] | 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 | |
Ezhilarasi | 12ee060 | 2019-04-17 18:01:14 +0530 | [diff] [blame^] | 82 | A resource source is modeled, following TOSCA_ node type definition and derives from the Resource_ source. |
| 83 | |
| 84 | Also 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 |