Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [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 | |
| 5 | Resource Definition |
Singal, Kapil (ks220y) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 6 | =================== |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 7 | .. toctree:: |
| 8 | :maxdepth: 2 |
| 9 | |
| 10 | Introduction: |
Singal, Kapil (ks220y) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 11 | ------------- |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 12 | A Resource definition 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 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 | |
| 18 | Creation of Resource definition is a standalone activity, separated from the blueprint design. |
| 19 | |
| 20 | As part of modelling a Resource definition entry, the following generic information should be provided: |
| 21 | |
| 22 | |image0| |
| 23 | |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 24 | Below are properties that all the resource source have will have |
| 25 | |
| 26 | The modeling does allow for data translation between external capability and CDS for both input and output key mapping. |
| 27 | |
| 28 | |image1| |
| 29 | |
| 30 | |
| 31 | Example: |
Singal, Kapil (ks220y) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 32 | -------- |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 33 | |
| 34 | vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them. |
| 35 | |
| 36 | Here 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) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 41 | { |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 42 | "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) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 81 | } |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 82 | |
| 83 | |
| 84 | Resource source: |
Singal, Kapil (ks220y) | 51e7c12 | 2020-09-25 17:22:54 -0400 | [diff] [blame] | 85 | ---------------- |
Singal, Kapil (ks220y) | f1aafc4 | 2020-09-24 12:47:56 -0400 | [diff] [blame] | 86 | |
| 87 | Defines the contract to resolve a resource. |
| 88 | |
| 89 | A resource source is modeled, following TOSCA_ node type definition and derives from the Resource_ source. |
| 90 | |
| 91 | Also 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 |