Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +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 | |
| 5 | Resource Source |
| 6 | --------------- |
| 7 | |
| 8 | Input: |
| 9 | ====== |
| 10 | Expects the value to be provided as input to the request. |
| 11 | |
| 12 | source-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 | |
| 22 | Default: |
| 23 | ======== |
| 24 | Expects the value to be defaulted in the model itself. |
| 25 | |
| 26 | source-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 | |
| 36 | sql: |
| 37 | ==== |
| 38 | |
| 39 | Expects 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 | |
| 41 | CDS 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 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 45 | .. |image0| image:: sqltable.jpg |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 46 | :width: 7.88889in |
| 47 | :height: 4.43750in |
| 48 | |
| 49 | .. toctree:: |
| 50 | :maxdepth: 1 |
| 51 | |
Ezhilarasi | 2efa541 | 2019-04-23 20:10:12 +0530 | [diff] [blame] | 52 | sourceprimarydbcode |
| 53 | |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 54 | Connection 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 | |
Ezhilarasi | 2efa541 | 2019-04-23 20:10:12 +0530 | [diff] [blame] | 59 | dbsystemcode |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 60 | |
| 61 | |
| 62 | REST: |
| 63 | ===== |
| 64 | |
| 65 | Expects the URI along with the VERB and the payload, if needed. |
| 66 | |
| 67 | CDS 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 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 71 | .. |image1| image:: resttable.jpg |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 72 | :width: 7.88889in |
| 73 | :height: 4.43750in |
| 74 | |
| 75 | .. toctree:: |
| 76 | :maxdepth: 1 |
| 77 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 78 | restsourcecode |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 79 | |
| 80 | Connection 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 | |
| 82 | Few ways are available to authenticate to the REST system: |
| 83 | |
| 84 | * token-auth |
| 85 | * basic-auth |
| 86 | * ssl-basic-auth |
| 87 | |
| 88 | For source code of Authentication click below link: |
| 89 | |
| 90 | .. toctree:: |
| 91 | :maxdepth: 1 |
| 92 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 93 | restauth |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 94 | |
| 95 | Capability: |
| 96 | =========== |
| 97 | |
| 98 | Expects a script to be provided. |
| 99 | |
| 100 | |image2| |
| 101 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 102 | .. |image2| image:: capabilitytable.jpg |
Ezhilarasi | 5e4307f | 2019-04-15 20:19:50 +0530 | [diff] [blame] | 103 | :width: 7.88889in |
| 104 | :height: 4.43750in |
| 105 | |
| 106 | |
| 107 | .. toctree:: |
| 108 | :maxdepth: 1 |
| 109 | |
Ezhilarasi | ba9ef91 | 2019-04-17 18:24:55 +0530 | [diff] [blame] | 110 | sourcecapabilitycode |
Ezhilarasi | 2efa541 | 2019-04-23 20:10:12 +0530 | [diff] [blame] | 111 | |
| 112 | Complex Type: |
| 113 | ============= |
| 114 | |
| 115 | Value will be resolved through REST., and output will be a complex type. |
| 116 | |
| 117 | Modeling reference: Modeling Concepts#rest |
| 118 | |
| 119 | In this example, we're making a POST request to an IPAM system with no payload. |
| 120 | |
| 121 | Some 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 | |
| 123 | As part of this request, the expected response will be as below. |
| 124 | |
| 125 | .. toctree:: |
| 126 | :maxdepth: 1 |
| 127 | |
| 128 | complexResponse |
| 129 | |
| 130 | What 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 | |
| 137 | The type of the data dictionary will be dt-netbox-ip. |
| 138 | |
| 139 | To 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 | |
| 144 | create_netbox_ip_address |