blob: 1bc0de4f1fe8c72d4ec744b01129e4bb346dc4ed [file] [log] [blame]
Ezhilarasi5e4307f2019-04-15 20:19:50 +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
5Resource Source
6---------------
7
8Input:
9======
10Expects the value to be provided as input to the request.
11
12source-input:
13
14{
15 "description": "This is Input Resource Source Node Type",
16 "version": "1.0.0",
17 "properties": {},
18 "derived_from": "tosca.nodes.ResourceSource"
19}
20
21
22Default:
23========
24Expects the value to be defaulted in the model itself.
25
26source-default:
27
28{
29 "description": "This is Default Resource Source Node Type",
30 "version": "1.0.0",
31 "properties": {},
32 "derived_from": "tosca.nodes.ResourceSource"
33}
34
35
36sql:
37====
38
39Expects the SQL query to be modeled; that SQL query can be parameterized, and the parameters be other resources resolved through other means. If that's the case, this data dictionary definition will have to define key-dependencies along with input-key-mapping.
40
41CDS is currently deployed along the side of SDNC, hence the primary database connection provided by the framework is to SDNC database.
42
43|image0|
44
Ezhilarasiba9ef912019-04-17 18:24:55 +053045.. |image0| image:: sqltable.jpg
Ezhilarasi5e4307f2019-04-15 20:19:50 +053046 :width: 7.88889in
47 :height: 4.43750in
48
49.. toctree::
50 :maxdepth: 1
51
Ezhilarasi2efa5412019-04-23 20:10:12 +053052sourceprimarydbcode
53
Ezhilarasi5e4307f2019-04-15 20:19:50 +053054Connection to a specific database can be expressed through the endpoint-selector property, which refers to a macro defining the information about the database the connect to. Understand TOSCA Macro in the context of CDS.
55
56.. toctree::
57 :maxdepth: 1
58
Ezhilarasi2efa5412019-04-23 20:10:12 +053059dbsystemcode
Ezhilarasi5e4307f2019-04-15 20:19:50 +053060
61
62REST:
63=====
64
65Expects the URI along with the VERB and the payload, if needed.
66
67CDS is currently deployed along the side of SDNC, hence the default rest connection provided by the framework is to SDNC MDSAL.
68
69|image1|
70
Ezhilarasiba9ef912019-04-17 18:24:55 +053071.. |image1| image:: resttable.jpg
Ezhilarasi5e4307f2019-04-15 20:19:50 +053072 :width: 7.88889in
73 :height: 4.43750in
74
75.. toctree::
76 :maxdepth: 1
77
Ezhilarasiba9ef912019-04-17 18:24:55 +053078 restsourcecode
Ezhilarasi5e4307f2019-04-15 20:19:50 +053079
80Connection to a specific REST system can be expressed through the endpoint-selector property, which refers to a macro defining the information about the REST system the connect to. Understand TOSCA Macro in the context of CDS.
81
82Few ways are available to authenticate to the REST system:
83
84 * token-auth
85 * basic-auth
86 * ssl-basic-auth
87
88For source code of Authentication click below link:
89
90.. toctree::
91 :maxdepth: 1
92
Ezhilarasiba9ef912019-04-17 18:24:55 +053093 restauth
Ezhilarasi5e4307f2019-04-15 20:19:50 +053094
95Capability:
96===========
97
98Expects a script to be provided.
99
100|image2|
101
Ezhilarasiba9ef912019-04-17 18:24:55 +0530102.. |image2| image:: capabilitytable.jpg
Ezhilarasi5e4307f2019-04-15 20:19:50 +0530103 :width: 7.88889in
104 :height: 4.43750in
105
106
107.. toctree::
108 :maxdepth: 1
109
Ezhilarasiba9ef912019-04-17 18:24:55 +0530110 sourcecapabilitycode
Ezhilarasi2efa5412019-04-23 20:10:12 +0530111
112Complex Type:
113=============
114
115Value will be resolved through REST., and output will be a complex type.
116
117Modeling reference: Modeling Concepts#rest
118
119In this example, we're making a POST request to an IPAM system with no payload.
120
121Some ingredients are required to perform the query, in this case, $prefixId. Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding.
122
123As part of this request, the expected response will be as below.
124
125.. toctree::
126 :maxdepth: 1
127
128 complexResponse
129
130What is of interest is the address and id fields. For the process to return these two values, we need to create a custom data-type, as bellow
131
132.. toctree::
133 :maxdepth: 1
134
135 dt-netbox-ip
136
137The type of the data dictionary will be dt-netbox-ip.
138
139To tell the resolution framework what is of interest in the response, the output-key-mapping section is used. The process will map the output-key-mapping to the defined data-type.
140
141.. toctree::
142 :maxdepth: 1
143
144create_netbox_ip_address