Resource Definition

Introduction:

A Resource definition models the how a specific resource can be resolved.

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.

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.

Creation of Resource definition is a standalone activity, separated from the blueprint design.

As part of modelling a Resource definition entry, the following generic information should be provided:

image0

Below are properties that all the resource source have will have

The modeling does allow for data translation between external capability and CDS for both input and output key mapping.

image1

Example:

vf-module-model-customization-uuid and vf-module-label are two data dictionaries. A SQL table, VF_MODULE_MODEL, exist to correlate them.

Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:

 1 {
 2   "description": "This is Component Resource Source Node Type",
 3   "version": "1.0.0",
 4   "properties": {
 5     "script-type": {
 6       "required": true,
 7       "type": "string",
 8       "default": "kotlin",
 9       "constraints": [
10         {
11           "valid_values": [
12             "kotlin",
13             "jython"
14           ]
15         }
16       ]
17     },
18     "script-class-reference": {
19       "description": "Capability reference name for internal and kotlin, for jython script file path",
20       "required": true,
21       "type": "string"
22     },
23     "instance-dependencies": {
24       "required": false,
25       "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
26       "type": "list",
27       "entry_schema": {
28         "type": "string"
29       }
30     },
31     "key-dependencies": {
32       "description": "Resource Resolution dependency dictionary names.",
33       "required": true,
34       "type": "list",
35       "entry_schema": {
36         "type": "string"
37       }
38     }
39   },
40   "derived_from": "tosca.nodes.ResourceSource"
41 }

Resource source:

Defines the contract to resolve a resource.

A resource source is modeled, following TOSCA node type definition and derives from the Resource source.

Also please click below for resource source available details