Roll to initial Honolulu version
[ccsdk/cds.git] / docs / modelingconcepts / dynamic-payload.rst
1 .. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts
2 .. This work is licensed under a Creative Commons Attribution 4.0
3 .. International License. http://creativecommons.org/licenses/by/4.0
4 .. Copyright (C) 2020 Deutsche Telekom AG.
5
6 Dynamic Payload
7 -------------------------------------
8
9 One of the most important API provided by the run time is to execute a CBA Package.
10
11 The nature of this API **request** and **response** is **model
12 driven** and **dynamic**.
13
14 Here is how the a **generic request** and **response** look like.
15
16 .. list-table::
17    :widths: 50 50
18    :header-rows: 1
19
20    * - request
21      - response
22    * - .. code-block:: json
23
24           {
25            "commonHeader": {
26               "originatorId": "",
27               "requestId": "",
28               "subRequestId": ""
29            },
30            "actionIdentifiers": {
31               "blueprintName": "",
32               "blueprintVersion": "",
33               "actionName": "",
34               "mode": ""
35            },
36            "payload": {
37               "$actionName-request": {
38                  "$actionName-properties": {
39                  }
40               }
41            }
42           }
43
44      - .. code-block:: json
45          
46           {
47            "commonHeader": {
48               "originatorId": "",
49               "requestId": "",
50               "subRequestId": ""
51            },
52            "actionIdentifiers": {
53               "blueprintName": "",
54               "blueprintVersion": "",
55               "actionName": "",
56               "mode": ""
57            },
58            "payload": {
59               "$actionName-response": {
60               }
61            }
62           }
63
64 The ``actionName``, under the ``actionIdentifiers`` refers to the name of a
65 Workflow (see :ref:`workflow`)
66
67 The content of the ``payload`` is what is fully dynamic / model driven.
68
69 The first **top level element** will always be either
70 ``$actionName-request`` for a request or ``$actionName-response`` for a response.
71
72 Then the **content within this element** is fully based on the
73 **workflow** **inputs** and **outputs**.
74
75 During the :ref:`enrichment` CDS will aggregate all the resources
76 defined to be resolved as input (see :ref:`node_type` -> Source -> Input), within mapping definition files
77 (see :ref:`artifact_type` -> Mapping), as data-type, that will then be use as type 
78 of an  input called ``$actionName-properties``.