Merge "Update documentation regarding authorized topics configuration in dmaap-client."
[dcaegen2.git] / docs / sections / design-components / DCAE-MOD / DCAE-MOD-User-Guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. _moduserguide:
4
5 ===================
6 DCAE MOD User Guide
7 ===================
8
9
10
11 -  `Types of Users and Usage
12    Instructions: <#DCAEMODUserGuide(draft)-TypesofUsersand>`__
13
14 -  `1.    Deployment of DCAE MOD components via Helm
15    charts <#DCAEMODUserGuide(draft)-1.DeploymentofD>`__
16
17    -  `Using DCAE MOD without an Ingress
18       Controller <#DCAEMODUserGuide(draft)-UsingDCAEMODwit>`__
19
20 -  `2.    Configuring DCAE
21    mod <#DCAEMODUserGuide(draft)-2.ConfiguringDC>`__
22
23 -  `3.    Design & Distribution
24    Flow <#DCAEMODUserGuide(draft)-3.Design&Distri>`__
25
26
27 Types of Users and Usage Instructions:
28 ======================================
29
30 +-------+-----------------------------+-----------------------------+
31 | Sr.No | User                        | Usage Instructions          |
32 +=======+=============================+=============================+
33 | 1.    | Developers who are looking  | -        Access the Nifi    |
34 |       | to onboard their mS         | Web UI url provided to you  |
35 |       |                             |                             |
36 |       |                             | -        Follow steps  2.c  |
37 |       |                             | to 2.f                      |
38 |       |                             |                             |
39 |       |                             | -        You should be able |
40 |       |                             | to see your microservices   |
41 |       |                             | in the Nifi Web UI by       |
42 |       |                             | clicking and dragging       |
43 |       |                             | ‘Processor’ on the canvas,  |
44 |       |                             | and searching for the name  |
45 |       |                             | of the                      |
46 |       |                             | micros                      |
47 |       |                             | ervice/component/processor. |
48 +-------+-----------------------------+-----------------------------+
49 | 2.    | Designers who are building  | -        Access the Nifi    |
50 |       | the flows through UI and    | Web UI url provided to you  |
51 |       | triggering distribution     |                             |
52 |       |                             | -        Follow steps 3 to  |
53 |       |                             | the end of the document     |
54 +-------+-----------------------------+-----------------------------+
55 | 3.    | Infrastructure/ Admins who  | -        Follow start to    |
56 |       | want to stand up DCAE Mod   | the end                     |
57 |       | and validate it             |                             |
58 +-------+-----------------------------+-----------------------------+
59
60
61 1.    Deployment of DCAE MOD components via Helm charts
62 =======================================================
63
64 The DCAE MOD components are deployed using the standard ONAP OOM
65 deployment process.   When deploying ONAP using the helm deploy command,
66 DCAE MOD components are deployed when the dcaemod.enabled flag is set to
67 true, either via a --set option on the command line or by an entry in an
68 overrides file.  In this respect, DCAE MOD is no different from any
69 other ONAP subsystem.
70
71 The default DCAE MOD deployment relies on an nginx ingress controller
72 being available in the Kubernetes cluster where DCAE MOD is being
73 deployed.   The Rancher RKE installation process sets up a suitable
74 ingress controller.   In order to enable the use of the ingress
75 controller, it is necessary to override the OOM default global settings
76 for ingress configuration.   Specifically, the installation needs to set
77 the following configuration in an override file::
78  
79   ingress:
80     enabled: true
81     virtualhost:
82       baseurl: "simpledemo.onap.org"
83
84 When DCAE MOD is deployed with an ingress controller, several endpoints
85 are exposed outside the cluster at the ingress controller's external IP
86 address and port.   (In the case of a Rancher RKE installation, there is
87 an ingress controller on every worker node, listening at the the
88 standard HTTP port (80).)  These exposed endpoints are needed by users
89 using machines outside the Kubernetes cluster.
90
91 +--------------+--------------------------------------------------+--------------------------+
92 | **Endpoint** | ** Routes to (cluster                            | **Description**          |
93 |              | internal address)**                              |                          |
94 +==============+==================================================+==========================+
95 | /nifi        | http://dcaemod-designtool:8080/nifi              | Design tool Web UI       |
96 |              |                                                  |                          |
97 +--------------+--------------------------------------------------+--------------------------+
98 | /nifi-api    | http://dcaemod-designtool:8080/nifi-api          | Design tool API          |
99 |              |                                                  |                          |
100 +--------------+--------------------------------------------------+--------------------------+
101 | /nifi-jars   | http://dcaemod-nifi-registry:18080/nifi-jars     | Flow registry listing of |
102 |              |                                                  | JAR files built from     |
103 |              |                                                  | component specs          |
104 +--------------+--------------------------------------------------+--------------------------+
105 | /onboarding  | http://dcaemod-onboarding-api:8080/onboarding    | Onboarding API           |
106 |              |                                                  |                          |
107 +--------------+--------------------------------------------------+--------------------------+
108 | /distributor | http://dcaemod-distributor-api:8080/distributor  | Distributor API          |
109 |              |                                                  |                          |
110 +--------------+--------------------------------------------------+--------------------------+
111
112 | To access the design Web UI, for example, a user would use the URL :
113   http://*ingress_controller_address:ingress_controller_port*/nifi.
114 | *ingress_controller_address* is the the IP address or DNS FQDN of the
115   ingress controller and
116 | *ingress_controller_port* is the port on which the ingress controller
117   is listening for HTTP requests.  (If the port is 80, the HTTP default,
118   then there is no need to specify a port.)
119
120 There are two additional *internal* endpoints that users need to know,
121 in order to configure a registry client and a distribution target in the
122 design tool's controller settings.
123
124 +------------------------+--------------------------------------------+
125 | **Configuration Item** | **Endpoint URL**                           |
126 +========================+============================================+
127 | Registry client        | http://dcaemod-nifi-registry:18080         |
128 +------------------------+--------------------------------------------+
129 | Distribution target    | http://dcaemod-runtime-api:9090            |
130 +------------------------+--------------------------------------------+
131
132 With Guilin release, OOM/ingress template has been updated to enable virtual host by default. 
133 All MOD API's and UI access via ingress should use dcaemod.simpledemo.onap.org.  
134
135 In order to access Design UI from local, add an entry for dcaemod.simpledemo.onap.org in /etc/hosts with the correct IP (any K8S node IP can be specified).
136
137
138 Using DCAE MOD without an Ingress Controller
139
140
141 Not currently supported
142
143
144 2.    Configuring DCAE mod
145 ==========================
146
147 **a. Configure Nifi Registry url**
148
149 Next check Nifi settings by selecting the Hamburger button in the Nifi
150 UI. It should lead you to the Nifi Settings screen
151
152 |image16|
153
154 |image3|
155
156 Add a registry client. The Registry client url will be
157 http://dcaemod-nifi-registry:18080
158
159 |image4|
160
161
162 **b. Add distribution target which will be the runtime api url**
163
164 Set the distribution target in the controller settings
165
166 |image17|
167
168 Distribution target URL will be
169 `http://dcaemod-runtime-api:9090 <http://dcaemod-runtime-api:9090/>`__
170
171
172
173 Now let’s access the Nifi (DCAE designer) UI - http://dcaemod.simpledemo.onap.org/nifi
174
175 IPAddress is the host address or the DNS FQDN, if there is one, for one of the Kubernetes nodes.
176
177 |image0|
178
179
180 **c. Get the artifacts to test and onboard.**
181
182 Let's fetch the artifacts/ spec files 
183
184 **Component Spec for DCAE-VES-Collector :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/spec/vescollector-componentspec.json
185
186 **Component Spec for DCAE-TCAgen2 :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/spec/vescollector-componentspec.json
187
188 **VES 5.28.4 Data Format :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/data-formats/VES-5.28.4-dataformat.json
189
190 **VES 7.30.2.1 Data Format :** https://git.onap.org/dcaegen2/collectors/ves/tree/etc/CommonEventFormat_30.2.1_ONAP.jsonormat.json
191
192 **VES Collector Response Data Format :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/data-formats/ves-response.json
193
194 **TCA CL Data Format :** https://git.onap.org/dcaegen2/analytics/tca-gen2/tree/dcae-analytics/dpo/dcaeCLOutput.json
195
196
197 For the purpose of onboarding, a Sample Request body should be of the type -::
198
199   { "owner": "<some value>", "spec": <some json object> }
200
201 where the json object inside the spec field can be a component spec json.
202
203 Request bodies of this type will be used in the onboarding requests you make using curl or the onboarding swagger interface.
204
205 **The prepared Sample Request body for a component dcae-ves-collector looks like
206 so –**
207
208 See :download:`VES Collector Spec <./Sample-Input-Files/Request-body-of-Sample-Component.json>`
209
210 **The prepared Sample request body for a sample data format  looks like so -**
211
212 See :download:`VES data Format <./Sample-Input-Files/Request-body-of-Sample-Data-Format.json>`
213
214
215
216 **d. To onboard a data format and a component**
217
218 Each component has a description that tells what it does.
219
220 These requests would be of the type
221
222 curl -X POST http://<onboardingapi host>/onboarding/dataformats     -H "Content-Type: application/json" -d
223 @<filepath to request>
224
225 curl -X POST http://<onboardingapi host>/onboarding/components     -H "Content-Type: application/json" -d
226 @<filepath to request>
227
228 In our case,
229
230 curl -X POST http://dcaemod.simpledemo.onap.org/onboarding/dataformats     -H "Content-Type: application/json" -d @<filepath to request>
231
232 curl -X POST http://dcaemod.simpledemo.onap.org/onboarding/components    -H "Content-Type: application/json" -d @<filepath to request>
233
234
235
236 **e. Verify the resources were created using**
237
238 curl -X GET http://<IPAddress>/onboarding/dataformats
239
240 curl -X GET http://<IPAddress>/onboarding/components
241
242 **f. Verify the genprocessor (which polls onboarding periodically to convert component specs to nifi processor), converted the component**
243
244 Open http://dcaemod.simpledemo.onap.org/nifi-jars in a browser.
245
246 These jars should now be available for you to use in the nifi UI as
247 processors
248
249 |image1|
250
251 3.    Design & Distribution Flow
252 ================================
253
254
255 **a**. To start creating flows, we need to create a process group first. The
256 name of the process group will be the name of the flow. Drag and Drop on
257 the canvas, the ‘Processor Group’ icon from the DCAE Designer bar on the
258 top.
259
260 |image2|
261
262
263 Now enter the process group by double clicking it,
264
265 You can now drag and drop on the canvas ‘Processor’ icon from the top
266 DCAE Designer tab. You can search for a particular component in the
267 search box that appears when you attempt to drag the ‘Processor’ icon to
268 the canvas.
269
270 |image5|
271
272 If the Nifi registry linking worked, you should see the “Import” button
273 when you try to add a Processor or Process group to the Nifi canvas,
274 like so-
275
276 |image6|
277
278 By clicking on the import button, we can import already created saved
279 and version controlled flows from the Nifi registry, if they are
280 present.
281
282 |image7|
283
284 We can save created flows by version controlling them like so starting
285 with a 'right click' anywhere on the canvas-
286
287 |image8|
288
289 Ideally you would name the flow and process group the same, because
290 functionally they are similar.
291
292 |image9|
293
294 When the flow is checked in, the bar at the bottom shows a green
295 checkmark
296
297 |image10|
298
299 Note: Even if you move a component around on the canvas, and its
300 position on the canvas changes, it is recognized as a change, and it
301 will have to recommitted.
302
303 You can add additional components in your flow and connect them.
304
305 DcaeVesCollector connects to DockerTcagen2.
306
307 |image11|
308
309 |image12|
310
311 |image13|
312
313 Along the way you need to also provide topic names in the settings
314 section. These can be arbitrary names.
315
316 |image14|
317
318 To recap, see how DcaeVesCollector connects to DockerTcagen2. Look at
319 the connection relationships. Currently there is no way to validate
320 these relationships. Notice how it is required to name the topics by
321 going to Settings.
322
323 The complete flow after joining our components looks like so
324
325 |image15|
326
327
328 **b. Submit/ Distribute the flow:**
329
330 Once your flow is complete and saved in the Nifi registry, you can
331 choose to submit it for distribution.
332
333 |image18|
334
335 If the flow was submitted successfully to the runtime api, you should
336 get a pop up a success message like so -
337
338 |image19|
339
340 At this step, the design was packaged and sent to Runtime api.
341
342 The runtime is supposed to generate the blueprint out of the packaged
343 design/flow and push it to the DCAE inventory and the DCAE Dasboard.
344
345 **c. Checking the components in the DCAE Dashboard**
346
347 You should see the generated artifact/ blueprint in the DCAE Dashboard
348 dashboard at https://<IPAddress>:30418/ccsdk-app/login_external.htm in
349 our deployment. The name for each component will be appended by the flow
350 name followed by underscore followed by the component’s name.
351
352 The credentials to access the DCAE Dashboard 
353
354 Login: su1234
355 Password: fusion
356
357
358 |image20|
359
360 |image21|
361
362 |image22|
363
364 The generated Blueprint can be viewed.
365
366 |image23|
367
368 Finally, the generated Blueprint can be deployed.
369
370 |image24|
371
372 You can use/import the attached input configurations files to deploy. Drag and Drop these sample JSON files to fill in the configuration values.
373 See :download:`VES Collector Input Configuration <./Sample-Input-Files/ves-deploy.input.json>`
374 See :download:`Tcagen2 Input Configuration <./Sample-Input-Files/tca-deploy.input.json>`
375
376 |image25|
377
378 |image26|
379
380 .. |image0| image:: ../images/1.png
381    :width: 6.5in
382    :height: 1.08333in
383 .. |image1| image:: ../images/2.png
384    :width: 6.5in
385    :height: 1.58333in
386 .. |image2| image:: ../images/3.png
387    :width: 5.83333in
388    :height: 3.58333in
389 .. |image3| image:: ../images/4.png
390    :width: 4.91667in
391    :height: 2.16667in
392 .. |image4| image:: ../images/5.png
393    :width: 6.5in
394    :height: 2.66667in
395 .. |image5| image:: ../images/6.png
396    :width: 6.5in
397    :height: 3.33333in
398 .. |image6| image:: ../images/7.png
399    :width: 4.91667in
400    :height: 2.25in
401 .. |image7| image:: ../images/8.png
402    :width: 4.91667in
403    :height: 2.58333in
404 .. |image8| image:: ../images/9.png
405    :width: 6.5in
406    :height: 4.58333in
407 .. |image9| image:: ../images/10.png
408    :width: 6.5in
409    :height: 4in
410 .. |image10| image:: ../images/11.png
411    :width: 4.91667in
412    :height: 0.41667in
413 .. |image11| image:: ../images/12.png
414    :width: 6.33333in
415    :height: 3.16667in
416 .. |image12| image:: ../images/13.png
417    :width: 6in
418    :height: 2.66667in
419 .. |image13| image:: ../images/14.png
420    :width: 6.5in
421    :height: 3.41667in
422 .. |image14| image:: ../images/15.png
423    :width: 6.5in
424    :height: 3.58333in
425 .. |image15| image:: ../images/16.png
426    :width: 6.5in
427    :height: 2.25in
428 .. |image16| image:: ../images/17.png
429    :width: 6.5in
430    :height: 2.83333in
431 .. |image17| image:: ../images/18.png
432    :width: 6.5in
433    :height: 3.08333in
434 .. |image18| image:: ../images/19.png
435    :width: 4.91667in
436    :height: 1.91667in
437 .. |image19| image:: ../images/20.png
438    :width: 4.91667in
439    :height: 2.41667in
440 .. |image20| image:: ../images/21.png
441    :width: 6.5in
442    :height: 2.41667in
443 .. |image21| image:: ../images/22.png
444    :width: 6.5in
445    :height: 3in
446 .. |image22| image:: ../images/23.png
447    :width: 6.5in
448    :height: 2.16667in
449 .. |image23| image:: ../images/24.png
450    :width: 6.5in
451    :height: 2.83333in
452 .. |image24| image:: ../images/25.png
453    :width: 6.5in
454    :height: 3in
455 .. |image25| image:: ../images/26.png
456 .. |image26| image:: ../images/27.png
457
458