blob: 49ef6a1a3f65d548df10a9aaf7e2884afdd7465f [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
Ezhilarasi5e4307f2019-04-15 20:19:50 +053012
Ezhilarasieac7ca42019-07-30 19:01:51 +053013
14.. code-block:: json
15 :linenos:
16
17 source-input
18 {
19 "description": "This is Input Resource Source Node Type",
20 "version": "1.0.0",
21 "properties": {},
22 "derived_from": "tosca.nodes.ResourceSource"
23 }
Ezhilarasi5e4307f2019-04-15 20:19:50 +053024
25
26Default:
27========
28Expects the value to be defaulted in the model itself.
29
Ezhilarasieac7ca42019-07-30 19:01:51 +053030.. code-block:: json
31 :linenos:
Ezhilarasi5e4307f2019-04-15 20:19:50 +053032
Ezhilarasieac7ca42019-07-30 19:01:51 +053033 source-default
34 {
35 "description": "This is Default Resource Source Node Type",
36 "version": "1.0.0",
37 "properties": {},
38 "derived_from": "tosca.nodes.ResourceSource"
39 }
Ezhilarasi5e4307f2019-04-15 20:19:50 +053040
41
42sql:
43====
44
45Expects 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.
46
47CDS is currently deployed along the side of SDNC, hence the primary database connection provided by the framework is to SDNC database.
48
49|image0|
50
Ezhilarasi326a1252019-07-19 19:55:00 +053051.. |image0| image:: media/sqltable.JPG
Ezhilarasi5e4307f2019-04-15 20:19:50 +053052 :width: 7.88889in
53 :height: 4.43750in
54
55.. toctree::
56 :maxdepth: 1
57
Ezhilarasi326a1252019-07-19 19:55:00 +053058 sourceprimarydbcode
Ezhilarasi2efa5412019-04-23 20:10:12 +053059
Ezhilarasi5e4307f2019-04-15 20:19:50 +053060Connection 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.
61
62.. toctree::
63 :maxdepth: 1
64
Ezhilarasi326a1252019-07-19 19:55:00 +053065 dbsystemcode
Ezhilarasi5e4307f2019-04-15 20:19:50 +053066
67
68REST:
69=====
70
71Expects the URI along with the VERB and the payload, if needed.
72
73CDS is currently deployed along the side of SDNC, hence the default rest connection provided by the framework is to SDNC MDSAL.
74
75|image1|
76
Ezhilarasi326a1252019-07-19 19:55:00 +053077.. |image1| image:: media/resttable.JPG
Ezhilarasi5e4307f2019-04-15 20:19:50 +053078 :width: 7.88889in
79 :height: 4.43750in
80
81.. toctree::
82 :maxdepth: 1
83
Ezhilarasiba9ef912019-04-17 18:24:55 +053084 restsourcecode
Ezhilarasi5e4307f2019-04-15 20:19:50 +053085
86Connection 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.
87
88Few ways are available to authenticate to the REST system:
89
90 * token-auth
91 * basic-auth
92 * ssl-basic-auth
93
94For source code of Authentication click below link:
95
96.. toctree::
97 :maxdepth: 1
98
Ezhilarasiba9ef912019-04-17 18:24:55 +053099 restauth
Ezhilarasi5e4307f2019-04-15 20:19:50 +0530100
101Capability:
102===========
103
104Expects a script to be provided.
105
106|image2|
107
Ezhilarasi326a1252019-07-19 19:55:00 +0530108.. |image2| image:: media/capabilitytable.JPG
Ezhilarasi5e4307f2019-04-15 20:19:50 +0530109 :width: 7.88889in
110 :height: 4.43750in
111
112
113.. toctree::
114 :maxdepth: 1
115
Ezhilarasi326a1252019-07-19 19:55:00 +0530116 sourcecapabilitycode
Ezhilarasi2efa5412019-04-23 20:10:12 +0530117
118Complex Type:
119=============
120
121Value will be resolved through REST., and output will be a complex type.
122
123Modeling reference: Modeling Concepts#rest
124
125In this example, we're making a POST request to an IPAM system with no payload.
126
127Some 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.
128
129As part of this request, the expected response will be as below.
130
131.. toctree::
132 :maxdepth: 1
133
Ezhilarasi326a1252019-07-19 19:55:00 +0530134 complexResponse
Ezhilarasi2efa5412019-04-23 20:10:12 +0530135
136What 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
137
138.. toctree::
139 :maxdepth: 1
140
Ezhilarasi326a1252019-07-19 19:55:00 +0530141 dt-netbox-ip
Ezhilarasi2efa5412019-04-23 20:10:12 +0530142
143The type of the data dictionary will be dt-netbox-ip.
144
145To 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.
146
147.. toctree::
148 :maxdepth: 1
149
Ezhilarasi326a1252019-07-19 19:55:00 +0530150 create_netbox_ip_address