DCAE Controller documentation DCAEGEN2-213
[dcaegen2.git] / docs / sections / components / dcae-cli / dmaap-connection-objects.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
2 .. http://creativecommons.org/licenses/by/4.0\r
3 \r
4 DMaaP connection objects\r
5 ========================\r
6 \r
7 DMaaP connection objects are JSON objects that:\r
8 \r
9 1. Components should expect at runtime in their application\r
10    configuration and is to be used to connect to the appropriate DMaaP\r
11    feed or topic.\r
12 2. Developers must provide through the command-line argument\r
13    ``--dmaap-file`` to test their component with manually provisioned\r
14    feeds and topics.\r
15 \r
16 This page is a reference to the specific structure that each type of\r
17 DMaaP stream requires.\r
18 \r
19 Note for #1 that components should expect the entire object with all\r
20 properties at runtime where the default will be ``null`` unless\r
21 specified otherwise.\r
22 \r
23 Note for #2 that developers are not required to provide the entire\r
24 object. The required properties will be labeled with “*required as\r
25 input*”.\r
26 \r
27 .. _dmaap-message-router:\r
28 \r
29 Message router\r
30 --------------\r
31 \r
32 Publishers and subscribers both have the same JSON object structure.\r
33 Here’s an example:\r
34 \r
35 .. code:: json\r
36 \r
37     {\r
38         "type": "message_router",\r
39         "aaf_username": "some-user",\r
40         "aaf_password": "some-password",\r
41         "dmaap_info": {\r
42             "client_role": "com.dcae.member",\r
43             "client_id": "1500462518108",\r
44             "location": "mtc00",\r
45             "topic_url": "https://we-are-message-router.us:3905/events/some-topic"\r
46         }\r
47     }\r
48 \r
49 \r
50 At the top-level:\r
51 \r
52 +-------------+----+--------------------+\r
53 | Property    | Ty\| Descript\          |\r
54 | Name        | pe | ion                |\r
55 +=============+====+====================+\r
56 | type        | st\| *Require\          |\r
57 |             | ri\| d \                |\r
58 |             | ng | as \               |\r
59 |             |    | input*.            |\r
60 |             |    | Must be            |\r
61 |             |    | ``message_router`` |\r
62 |             |    | for                |\r
63 |             |    | message            |\r
64 |             |    | router             |\r
65 |             |    | topics             |\r
66 +-------------+----+--------------------+\r
67 | aaf_usernam\| st\| AAF                |\r
68 | e           | ri\| username           |\r
69 |             | ng | message            |\r
70 |             |    | router             |\r
71 |             |    | clients            |\r
72 |             |    | use to             |\r
73 |             |    | authenti\          |\r
74 |             |    | cate               |\r
75 |             |    | with               |\r
76 |             |    | secure             |\r
77 |             |    | topics             |\r
78 +-------------+----+--------------------+\r
79 | aaf_passwor\| st\| AAF                |\r
80 | d           | ri\| password           |\r
81 |             | ng | message            |\r
82 |             |    | router             |\r
83 |             |    | clients            |\r
84 |             |    | use to             |\r
85 |             |    | authenti\          |\r
86 |             |    | cate               |\r
87 |             |    | with               |\r
88 |             |    | secure             |\r
89 |             |    | topics             |\r
90 +-------------+----+--------------------+\r
91 | dmaap_info  | JS\| *Require\          |\r
92 |             | ON | d \                |\r
93 |             | ob\| as \               |\r
94 |             | je\| input*.            |\r
95 |             | ct | Contains           |\r
96 |             |    | the                |\r
97 |             |    | topic              |\r
98 |             |    | connecti\          |\r
99 |             |    | on                 |\r
100 |             |    | details            |\r
101 +-------------+----+--------------------+\r
102 \r
103 The ``dmaap_info`` object contains:\r
104 \r
105 +-------------+----+----------+\r
106 | Property    | Ty\| Descript\|\r
107 | Name        | pe | ion      |\r
108 +=============+====+==========+\r
109 | client_role | st\| AAF      |\r
110 |             | ri\| client   |\r
111 |             | ng | role     |\r
112 |             |    | that’s   |\r
113 |             |    | requesti\|\r
114 |             |    | ng       |\r
115 |             |    | publish  |\r
116 |             |    | or       |\r
117 |             |    | subscrib\|\r
118 |             |    | e        |\r
119 |             |    | access   |\r
120 |             |    | to the   |\r
121 |             |    | topic    |\r
122 +-------------+----+----------+\r
123 | client_id   | st\| Client   |\r
124 |             | ri\| id for   |\r
125 |             | ng | given    |\r
126 |             |    | AAF      |\r
127 |             |    | client   |\r
128 +-------------+----+----------+\r
129 | location    | st\| DCAE     |\r
130 |             | ri\| location |\r
131 |             | ng | for the  |\r
132 |             |    | publishe\|\r
133 |             |    | r        |\r
134 |             |    | or       |\r
135 |             |    | subscrib\|\r
136 |             |    | er,      |\r
137 |             |    | used to  |\r
138 |             |    | set up   |\r
139 |             |    | routing  |\r
140 +-------------+----+----------+\r
141 | topic_url   | st\| *Require\|\r
142 |             | ri\| d \      |\r
143 |             | ng | as \     |\r
144 |             |    | input*.  |\r
145 |             |    | URL for  |\r
146 |             |    | accessin\|\r
147 |             |    | g        |\r
148 |             |    | the      |\r
149 |             |    | topic to |\r
150 |             |    | publish  |\r
151 |             |    | or       |\r
152 |             |    | receive  |\r
153 |             |    | events   |\r
154 +-------------+----+----------+\r
155 \r
156 Here’s an example of the minimal JSON that must be provided as an input:\r
157 \r
158 .. code:: json\r
159 \r
160     {\r
161         "type": "message_router",\r
162         "dmaap_info": {\r
163             "topic_url": "https://we-are-message-router.us:3905/events/some-topic"\r
164         }\r
165     }\r
166 \r
167 .. _dmaap-data-router:\r
168 \r
169 Data router\r
170 -----------\r
171 \r
172 Publisher\r
173 ~~~~~~~~~\r
174 \r
175 Here’s an example of what the JSON object connection for data router\r
176 publisher looks like:\r
177 \r
178 .. code:: json\r
179 \r
180     {\r
181         "type": "data_router",\r
182         "dmaap_info": {\r
183             "location": "mtc00",\r
184             "publish_url": "https://we-are-data-router.us/feed/xyz",\r
185             "log_url": "https://we-are-data-router.us/feed/xyz/logs",\r
186             "username": "some-user",\r
187             "password": "some-password",\r
188             "publisher_id": "123456"\r
189         } \r
190     }\r
191 \r
192 At the top-level:\r
193 \r
194 +-------------+----+----------------+\r
195 | Property    | Ty\| Descript\      |\r
196 | Name        | pe | ion            |\r
197 +=============+====+================+\r
198 | type        | st\| *Require\      |\r
199 |             | ri\| d \            |\r
200 |             | ng | as \           |\r
201 |             |    | input*.        |\r
202 |             |    | Must be        |\r
203 |             |    | ``data_router``|\r
204 |             |    | for data       |\r
205 |             |    | router         |\r
206 |             |    | feeds          |\r
207 +-------------+----+----------------+\r
208 | dmaap_info  | JS\| *Require\      |\r
209 |             | ON | d \            |\r
210 |             | ob\| as \           |\r
211 |             | je\| input*.        |\r
212 |             | ct | Contains       |\r
213 |             |    | the            |\r
214 |             |    | topic          |\r
215 |             |    | connecti\      |\r
216 |             |    | on             |\r
217 |             |    | details        |\r
218 +-------------+----+----------------+\r
219 \r
220 The ``dmaap_info`` object contains:\r
221 \r
222 +-------------+----+----------+\r
223 | Property    | Ty\| Descript\|\r
224 | Name        | pe | ion      |\r
225 +=============+====+==========+\r
226 | location    | st\| DCAE     |\r
227 |             | ri\| location |\r
228 |             | ng | for the  |\r
229 |             |    | publishe\|\r
230 |             |    | r,       |\r
231 |             |    | used to  |\r
232 |             |    | set up   |\r
233 |             |    | routing  |\r
234 +-------------+----+----------+\r
235 | publish_url | st\| *Require\|\r
236 |             | ri\| d \      |\r
237 |             | ng | as \     |\r
238 |             |    | input*.  |\r
239 |             |    | URL to   |\r
240 |             |    | which    |\r
241 |             |    | the      |\r
242 |             |    | publishe\|\r
243 |             |    | r        |\r
244 |             |    | makes    |\r
245 |             |    | Data     |\r
246 |             |    | Router   |\r
247 |             |    | publish  |\r
248 |             |    | requests |\r
249 +-------------+----+----------+\r
250 | log_url     | st\| URL from |\r
251 |             | ri\| which    |\r
252 |             | ng | log data |\r
253 |             |    | for the  |\r
254 |             |    | feed can |\r
255 |             |    | be       |\r
256 |             |    | obtained |\r
257 +-------------+----+----------+\r
258 | username    | st\| Username |\r
259 |             | ri\| the      |\r
260 |             | ng | publishe\|\r
261 |             |    | r        |\r
262 |             |    | uses to  |\r
263 |             |    | authenti\|\r
264 |             |    | cate     |\r
265 |             |    | to Data  |\r
266 |             |    | Router   |\r
267 +-------------+----+----------+\r
268 | password    | st\| Password |\r
269 |             | ri\| the      |\r
270 |             | ng | publishe\|\r
271 |             |    | r        |\r
272 |             |    | uses to  |\r
273 |             |    | authenti\|\r
274 |             |    | cate     |\r
275 |             |    | to Data  |\r
276 |             |    | Router   |\r
277 +-------------+----+----------+\r
278 | publisher_i | st\| Publishe\|\r
279 | d           | ri\| r        |\r
280 |             | ng | id in    |\r
281 |             |    | Data     |\r
282 |             |    | Router   |\r
283 +-------------+----+----------+\r
284 \r
285 Here’s an example of the minimal JSON that must be provided as an input:\r
286 \r
287 .. code:: json\r
288 \r
289     {\r
290         "type": "data_router",\r
291         "dmaap_info": {\r
292             "publish_url": "https://we-are-data-router.us/feed/xyz"\r
293         }\r
294     }\r
295 \r
296 Subscriber\r
297 ~~~~~~~~~~\r
298 \r
299 Here’s an example of what the JSON object connection for data router\r
300 subscriber looks like:\r
301 \r
302 .. code:: json\r
303 \r
304     {\r
305         "type": "data_router",\r
306         "dmaap_info": {\r
307             "location": "mtc00",\r
308             "delivery_url": "https://my-subscriber-app.dcae:8080/target-path",\r
309             "username": "some-user",\r
310             "password": "some-password",\r
311             "subscriber_id": "789012"\r
312         } \r
313     }\r
314 \r
315 At the top-level:\r
316 \r
317 +-------------+----+----------------+\r
318 | Property    | Ty\| Descript\      |\r
319 | Name        | pe | ion            |\r
320 +=============+====+================+\r
321 | type        | st\| *Require\      |\r
322 |             | ri\| d              |\r
323 |             | ng | as \           |\r
324 |             |    | input*.        |\r
325 |             |    | Must be        |\r
326 |             |    | ``data_router``|\r
327 |             |    | for data       |\r
328 |             |    | router         |\r
329 |             |    | feeds          |\r
330 +-------------+----+----------------+\r
331 | dmaap_info  | JS\| *Require\      |\r
332 |             | ON | d \            |\r
333 |             | ob\| as \           |\r
334 |             | je\| input*.        |\r
335 |             | ct | Contains       |\r
336 |             |    | the            |\r
337 |             |    | topic          |\r
338 |             |    | connecti\      |\r
339 |             |    | on             |\r
340 |             |    | details        |\r
341 +-------------+----+----------------+\r
342 \r
343 The ``dmaap_info`` object contains:\r
344 \r
345 +--------------+----+----------+\r
346 | Property     | Ty\| Descript\|\r
347 | Name         | pe | ion      |\r
348 +==============+====+==========+\r
349 | location     | st\| DCAE     |\r
350 |              | ri\| location |\r
351 |              | ng | for the  |\r
352 |              |    | publishe\|\r
353 |              |    | r,       |\r
354 |              |    | used to  |\r
355 |              |    | set up   |\r
356 |              |    | routing  |\r
357 +--------------+----+----------+\r
358 | delivery_ur\ | st\| URL to   |\r
359 | l            | ri\| which    |\r
360 |              | ng | the Data |\r
361 |              |    | Router   |\r
362 |              |    | should   |\r
363 |              |    | deliver  |\r
364 |              |    | files    |\r
365 +--------------+----+----------+\r
366 | username     | st\| Username |\r
367 |              | ri\| Data     |\r
368 |              | ng | Router   |\r
369 |              |    | uses to  |\r
370 |              |    | authenti\|\r
371 |              |    | cate     |\r
372 |              |    | to the   |\r
373 |              |    | subscrib\|\r
374 |              |    | er       |\r
375 |              |    | when     |\r
376 |              |    | deliveri\|\r
377 |              |    | ng       |\r
378 |              |    | files    |\r
379 +--------------+----+----------+\r
380 | password     | st\| Password |\r
381 |              | ri\| Data     |\r
382 |              | ng | Router   |\r
383 |              |    | uses to  |\r
384 |              |    | authenti\|\r
385 |              |    | cate     |\r
386 |              |    | to the   |\r
387 |              |    | subscrib\|\r
388 |              |    | er       |\r
389 |              |    | when     |\r
390 |              |    | deliveri\|\r
391 |              |    | ng       |\r
392 |              |    | files    |\r
393 +--------------+----+----------+\r
394 | subscriber_i\| st | Subscrib\|\r
395 | d            | ri | er       |\r
396 |              | ng | id in    |\r
397 |              |    | Data     |\r
398 |              |    | Router   |\r
399 +--------------+----+----------+\r
400 \r
401 Here’s an example of the minimal JSON that must be provided as an input:\r
402 \r
403 .. code:: json\r
404 \r
405     {\r
406         "type": "data_router",\r
407         "dmaap_info": {\r
408         }\r
409     }\r
410 \r
411 Developers are recommended to use ``username`` and ``password`` since\r
412 this is the recommended security practice.\r
413 \r
414 Note that the dcae-cli will construct the ``delivery_url`` when\r
415 deploying the component since this can only be known at deployment time.\r