summaryrefslogtreecommitdiffstats
path: root/docs/offeredapis/api.rst
blob: 042885049d3bd7f85e6aa1f5c1947f65b7027080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

Offered APIs
~~~~~~~~~~~~

.. toctree::
    :maxdepth: 3

DMaaP Message Router utilizes an HTTP REST API to service all Publish
and Consume transactions. HTTP and REST standards are followed so
clients as varied as CURL, Java applications and even Web Browsers will
work to interact with Message Router.Message Router uses AAF for user's
authentication and authorization.

General HTTP Requirements
-------------------------

A DMaaP Message Router transactions consists of 4 distinct segments,
HTTP URL, HTTP Header, HTTP Body (POST) and HTTP Response. The general
considerations for each segment are as follows and are required for each
of the specific transactions described in this section.

HTTP URL
-------

http[s]://serverBaseURL{/routing}{resourcePath}

- The serverBaseURL points to DMaaP Message Router host/port that will service the request.

- The resourcePath specifies the specific service, or Topic, that the client is attempting to reach

HTTP Header
-----------

Specifies HTTP Headers, such as Content-Type, that define the parameters
of the HTTP Transaction

HTTP Body
---------

The HTTP Body contains the topic content when Publishing or Consuming.
The Body may contain topic messages in several formats (like below) but
it must be noted, that, except in very specific circumstances, messages
are not inspected for content.


+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| Content-Type            |  Description                                                                                                    |
+=========================+=================================================================================================================+
| text/plain              | Each line in the POST body is treated as a separate message. No partition key is specified, and therefore no    |
|                         | order is guaranteed. This format is mainly for test, as messages are highly likely to be re-ordered when        |
|                         | delivered through the Kafka cluster.                                                                            |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| application/json        | The payload maybe a single JSON object or a JSON array of JSON objects. Each object is handled as an individual |
|                         | message..Note that use of this format may result in equivalent but altered JSON objects sent to consumers.      |
|                         | That's because MR uses a standard JSON parser to read each object into memory before pushing the object to the  |
|                         | Kafka system. At that point, the JSON object is re-written from the in-memory object. This can result in        |
|                         | re-ordered fields or changes in whitespace. If you want to preserve JSON objects exactly,                       |
|                         | use application/cambria. Recommended to follow the JSON format.                                                 |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+

Publishers
-----------

**Description**:Publishes data to Kafka server on the topic mentioned in the URL.
Messages will be in the request body

The MessageRouter service has no requirements on what publishers can put
onto a topic. The messages are opaque to the service and are treated as
raw bytes. In general, passing JSON messages is preferred, but this is
due to higher-level features and related systems, not the MessageRouter
broker itself. 

Request URL
===========

POST http(s)://{HOST:PORT}/events/{topicname}

Request Parameters
==================

+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
| Name               | Description                  | Param Type       | Data type  | Max Len   | Required    | Format                         | Valid/EXample values        |
+====================+==============================+==================+============+===========+=============+================================+=============================+
| Topicname          | topic name to be posted      | Path             | String     | 40        | Y           |                                | org.onap.dmaap.mr.testtopic |
+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
| content-type       | To specify type of message   | Header           | String     | 20        | N           |                                | application/json            |
+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
| Username           | userid                       | Header           | String     |           | N           | Basic Authentication Header    |                             |
+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
| Password           |                              | Header           | String     |           | N           | Basic Authentication Header    |                             |
+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
| partitionKey       |                              | QueryParam       | String     |           | N           | String value                   | ?Partitionkey=123           |
+--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+

**NOTE**: To publish data to the authenticated topic, Publisher must
 have the AAF permission org.onap.dmaap.mr.topic|:topic.<topic name>|pub. 
Publishers may use DMaaP BusController for provisoning the AAF permissions

Response Parameters
===================

+------------------+------------------------+------------+--------------+------------------------------+
| Name             | Description            | Type       | Format       | Valid/Example Values         |
+==================+========================+============+==============+==============================+
| httpStatusCode   |                        |            |              | 200, 201 etc.                |
+------------------+------------------------+------------+--------------+------------------------------+
| mrErrorCode      | Numeric error code     |            |              | 200, 201 etc.                |
+------------------+------------------------+------------+--------------+------------------------------+
| errorMessage     |                        |            |              | SUCCESS, or error message.   |
+------------------+------------------------+------------+--------------+------------------------------+
| helpURL          | helpurl                |            |              |                              |
+------------------+------------------------+------------+--------------+------------------------------+
| transactionid    | transaction-id value   |            |              |                              |
+------------------+------------------------+------------+--------------+------------------------------+



Response /Error Codes
=====================

+---------------------------+------------------------------------+
| Response statusCode       |  Response statusMessage            |
+===========================+====================================+
| 200-299                   | Success                            |
+---------------------------+------------------------------------+
| 400-499                   | the client request has a problem   |
+---------------------------+------------------------------------+
| 500-599                   | the DMaaP service has a problem    |
+---------------------------+------------------------------------+

+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| Error code             |  HTTPCode     |  Description                    | Issue Reason                                                                                            |
+========================+===============+=================================+=========================================================================================================+
| DMaaP\_MR\_ERR\_3001   | 413           | Request Entity too large        | Message size exceeds the batch limit <limit>.Reduce the batch size and try again                        |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3002   | 500           | Internal Server Error           | Unable to publish messages. Please contact administrator                                                |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3003   | 400           | Bad Request                     | Incorrect Batching format. Please correct the batching format and try again                             |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3004   | 413           | Request Entity too large        | Message size exceeds the message size limit <limit>.Reduce the message size and try again               |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3005   | 400           | Bad Request                     | Incorrect JSON object. Please correct the JSON format and try again                                     |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3006   | 504           | Network Connect Timeout Error   | Connection to the DMaaP MR was timed out.Please try again                                               |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3007   | 500           | Internal Server Error           | Failed to publish  messages to topic <topicName>. Successfully published <count > number of messages.   |
+------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+

Sample Request:
===============

+-----------------------------------------------------------------------------------+
| POST                                                                              |
|                                                                                   |
| *Payload-* *{"message":"message description"}* *Content-Type: application/json*   |
|                                                                                   |
| Example:                                                                          |
|                                                                                   |
| curl -u XXXX@abc.com:X -H 'Content-Type:text/plain' -X POST -d @sampleMsg.txt     |
|                                                                                   |
| {    "count": 1,                                                                  |
|                                                                                   |
|     "serverTimeMs": 19"                                                           |
|                                                                                   |
| }                                                                                 |
+-----------------------------------------------------------------------------------+

Sample Response:
================

+---------------------------------------------------------------------+
| HTTP/1.1 200 OK                                                     |
|                                                                     |
|     Server: Apache-Coyote/1.1                                       |
|                                                                     |
|     transactionId: 28-12-2015::08:18:50:682::<IP>::28122015552391   |
|                                                                     |
|     Content-Type: application/json                                  |
|                                                                     |
|     Content-Length: 42                                              |
|                                                                     |
|     Date: Mon, 28 Dec 2015 13:18:50 GMT                             |
+---------------------------------------------------------------------+



Subscribers
-----------
**Description**:To subscribe to a MessageRouter topic, a subscriber issues a GET to the RESTful HTTP endpoint for events.

Request URL:
============

GET http(s)://{HOST:PORT}}/events/{topicname}/{consumegroup}/{consumerid}/{timeout=x}

Request Parameters:
===================

+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| Name         | Description                     |  Param Type      |  data type |   MaxLen     |  Required   |  Format             |  Valid/Example Values  |
+==============+=================================+==================+============+==============+=============+=====================+========================+
| Topicname    | topic name to be posted         |     Path         |   String   |    40        |     Y       |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| Consumer     | A name that uniquely identifies |     Path         |   String   |              |     Y       |                     | CG1                    |
| group        | your subscribers                |                  |            |              |             |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| consumerId   | Within your subscribers group,  |     Path         |   String   |              |     Y       |                     | C1                     |
|              | a name that uniquely identifies |                  |            |              |             |                     |                        |
|              | your subscribers  process       |                  |            |              |             |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| content-type | To specify type of message      |     Header       |   String   |     20       |     N       |                     | aplication/json        |
|              | content(json,text or cambria)   |                  |            |              |             |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| Username     | userid                          |     Header       |   String   |     1        |     N       |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
| Password     |                                 |     Header       |   String   |     1        |     N       |                     |                        |
+--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+

**NOTE**:To read data from a authenticated topic, User must have the 
AAF permission org.onap.dmaap.mr.topic|:topic.<topic name>|sub. 
Subscribers may use DMaaP BusController for provisoning the permissions in AAF

Response Parameters:
====================

+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| Name             | Description                    |  Type      | Format       | Valid/Example Values                                      |
+==================+================================+============+==============+===========================================================+
| httpStatusCode   |                                |            |              | 200, 201 etc.                                             |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| mrErrorCode      | Numeric error code             |            |              | 200, 201 etc.                                             |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| errorMessage     |                                |            |              | SUCCESS, or error message.                                |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| helpURL          | helpurl                        |            |              |                                                           |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| tranactionid     | transaction-id value           |            |              | 28-12-2015::08:18:50:682::135.25.227.66::28122015552391   |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| ResponseBody     | Messages consumed from topic   | Json       | Json         |                                                           |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+


Response /Error Codes
=====================


+---------------------------+------------------------------------+
| Response statusCode       | Response statusMessage             |
+===========================+====================================+
| 200-299                   | Success                            |
+---------------------------+------------------------------------+
| 400-499                   | the client request has a problem   |
+---------------------------+------------------------------------+
| 500-599                   | the DMaaP service has a problem    |
+---------------------------+------------------------------------+

+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
| Error code              |  HTTPCode       |  Description               | Issue Reason                                                                                |
+=========================+=================+============================+=============================================================================================+
| DMaaP\_MR\_ERR\_3008    | 413             | Request Entity too large   | Message size exceeds the batch limit <limit>.Reduce the batch size and try again            |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3009    | 500             | Internal Server Error      | Unable to publish messages. Please contact administrator                                    |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3010    | 400             | Bad Request                | Incorrect Batching format. Please correct the batching format and try again                 |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_3011    | 413             | Request Entity too large   | Message size exceeds the message size limit <limit>.Reduce the message size and try again   |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
| DMaaP\_MR\_ERR\_5012    | 429             | Too many requests          | This client is making too many requests. Please use a long poll setting to decrease the     |
|                         |                 |                            | number of requests that result in empty responses.                                          |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
|                         | 503             | Service Unavailable        | Service Unavailable.                                                                        |
+-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+

Sample Request:
===============

+----------------------------------------------------------------------------------------------------+
| GET  http://<hostname>:3904/events/com.att.dmaap.mr.sprint/mygroup/mycus                           |
|                                                                                                    |
| Content-Type: application/json                                                                     |
|                                                                                                    |
| Example:                                                                                           |
|                                                                                                    |
|curl -u XXX@csp.abc.com:MRDmap2016$ -X GET -d 'MyfirstMessage'                                      |
|                                                                                                    |
|http://mrlocal00.dcae.proto.research.att.com:3904/events/com.att.ecomp_test.crm.preDeo/myG/C1       |
|                                                                                                    |
|[I am r sending first msg,I am R sending first msg]                                                 |
+----------------------------------------------------------------------------------------------------+

Provisioning
------------
**Description**: To create , modify or delete the MessageRouter topics.These APIs can also be used by other applications to provision topics in MessageRouter.
DMaaP BusController is recommended for topic and AAf permissions provisoning

Create Topic
============
Request URL:
============

POST http(s)://{HOST:PORT}/topics/create

Request Parameters:
===================

+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| Name              | Description                     |  Param Type      |  datatype  |   MaxLen     |  Required   |  Format     |  Valid/Example Values             |
+===================+=================================+==================+============+==============+=============+=============+===================================+
| Topicname         | topicname to be created in MR   |     Body         |   String   |     20       |     Y       | Json        | org.onap.dmaap.mr.metrics          |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| topicDescription  | description for topic           |     Body         |   String   |     15       |     Y       |             |                                   |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| partitionCount    | Kafka topic partition           |     Body         |   String   |     1        |    Y        |             |                                   |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| replicationCount  | Kafka topic replication         |     Body         |   String   |     1        |    Y        |             | 3 (Default -for 3 node Kafka )    |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| transaction       | to create transaction id for    |     Body         |  Boolean   |     1        |    N        |             | true                              |
| Enabled           | each message transaction        |                  |            |              |             |             |                                   |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
| Content-Type      | application/json                |     Header       |   String   |              |             |             | application/json                  |
+-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+

**NOTE**:To Create a authenticated topic, user must have the AAF permission
 org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:org.onap.dmaap.mr|create 


+---------------------------+------------------------------------+
| Response statusCode       | Response statusMessage             |
+===========================+====================================+
| 200-299                   | Success                            |
+---------------------------+------------------------------------+
| 400-499                   | the client request has a problem   |
+---------------------------+------------------------------------+
| 500-599                   | the DMaaP service has a problem    |
+---------------------------+------------------------------------+


+-------------------------+-----------------+--------------------------------------------------+
| Error code              |  HTTP Code      |  Description                                     |
+=========================+=================+==================================================+
| DMaaP\_MR\_ERR\_5001    | 500             | Failed to retrieve list of all topics            |
+-------------------------+-----------------+--------------------------------------------------+
| DMaaP\_MR\_ERR\_5002    | 500             | Failed to retrieve details of topic:<topicName>  |
+-------------------------+-----------------+--------------------------------------------------+
| DMaaP\_MR\_ERR\_5003    | 500             | Failed to create topic:<topicName>               |
+-------------------------+-----------------+--------------------------------------------------+
| DMaaP\_MR\_ERR\_5004    | 500             | Failed to delete topic:<topicName>               |
+-------------------------+-----------------+--------------------------------------------------+


Response Parameters
====================

+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| Name             | Description                    |  Type      | Format       | Valid/Example Values                                      |
+==================+================================+============+==============+===========================================================+
| httpStatusCode   |                                |            |              | 200, 201 etc.                                             |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| mrErrorCode      | Numeric error code             |            |              | 5005                                                      |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| errorMessage     |                                |            |              | SUCCESS, or error message.                                |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| helpURL          | helpurl                        |            |              |                                                           |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
| ResponseBody     | Topic details (owner,          |  Json      |  Json        |                                                           |
|                  | trxEnabled=true)               |            |              |                                                           |
+------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+


Sample Request:
===============

    .. code:: bash

      POST   http://<hostname>:3904/topic/create
  Request Body
  {"topicName":"org.onap.dmaap.mr.testtopic","description":"This is a test Topic ",
  "partitionCount":"1","replicationCount":"3","transactionEnabled":"true"}
  Content-Type: application/json
  Example:
  curl -u XXXc@csp.abc.com:xxxxx$  -H 'Content-Type:application/json' -X POST -d
  @topicname.txt  http://message-router:3904/topics/create
  {
  "writerAcl": {
  "enabled": false,
  "users": []
  },
  "description": "This is a TestTopic",
  "name": "org.onap.dmaap.mr.testtopic",
  "readerAcl": {
  "enabled": false,
  "users": []


GetTopic Details
----------------

Request URL
===========

GET http(s)://{HOST:PORT}/topics    : To list the details of all the topics in Message Router.

GET http(s)://{HOST:PORT}/topics/{topicname} : To list the details of specified topic .

Request Parameters
==================

+--------------------------+-------------------------+------------------+------------+-----------+-------------+-----------------+-----------------------------+
| Name                     | Description             | Param Type       | Data type  | Max Len   | Required    | Format          | Valid/EXample values        |
+==========================+=========================+==================+============+===========+=============+=================+=============================+
| Topicname                | topic name details      | Body             | String     | 20        | Y           |  Json           | org.onap.dmaap.mr.testtopic |
+--------------------------+-------------------------+------------------+------------+-----------+-------------+-----------------+-----------------------------+

**NOTE**:To view a authenticated topic, user must have the AAF permission
 org.onap.dmaap.mr.topic|*|view 


Response Parameters
====================

+------------------+------------------------+------------+----------+---------+----------------------------+
| Name             | Description            | ParamType  | datatype |Format   | Valid/Example Values       |
+==================+========================+============+==========+=========+============================+
| topicname        |  topic name details    |      Body  |   String |   Json  | org.onap.dmaap.mr.testopic |
+------------------+------------------------+------------+----------+---------+----------------------------+
| description      |                        |            |   String |         |                            |
+------------------+------------------------+------------+----------+---------+----------------------------+
| owner            |user id who created the |            |          |         |                            |
|                  |         topic          |            |          |         |                            |
+------------------+------------------------+------------+----------+---------+----------------------------+
| txenabled        |     true or false      |            |  boolean |         |                            |
+------------------+------------------------+------------+----------+---------+----------------------------+

+---------------------------+------------------------------------+
| Response statusCode       | Response statusMessage             |
+===========================+====================================+
| 200-299                   | Success                            |
+---------------------------+------------------------------------+
| 400-499                   | the client request has a problem   |
+---------------------------+------------------------------------+
| 500-599                   | the DMaaP service has a problem    |
+---------------------------+------------------------------------+


Sample Request:
===============

+-----------------------------------------------------------------------------------------------------------------------------------+
| GET   http://<hostname>:3904/topic/com.att.dmaap.mr.testtopic                                                                     |
|       curl -u XXX@csp.abc.com:x$  -X                                                                                              |
| GET  http://mrlocal00.dcae.proto.research.att.com:3904/topics                                                                     |
|    {"topics": [                                                                                                                   |
|    {"txenabled": true,"description": "This is a TestTopic","owner": "XXXX@csp.abc.com","topicName": "org.onap.dmaap.mr.Load9"|
|    {"txenabled": false,"description": "", "owner": "", "topicName": "org.onap.dmaap.mr.Load1"                                |
|    ]},                                                                                                                            |
+-----------------------------------------------------------------------------------------------------------------------------------+


Delete Topics
-------------

Request URL:
============

DELETE http(s)://{HOST:PORT}/topic/{topicname}

**NOTE**:To delete a  topic, user must have the AAF permission
org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic:org.onap.dmaap.mr|destroy 

Sample Request:
===============
ex: http://<hostname>:3904/dmaap/v1/topics/org.onap.dmaap.mr.testopic

+---------------------------+------------------------------------+
| Response statusCode       | Response statusMessage             |
+===========================+====================================+
| 200-299                   | Success                            |
+---------------------------+------------------------------------+
| 400-499                   | the client request has a problem   |
+---------------------------+------------------------------------+
| 500-599                   | the DMaaP service has a problem    |
+---------------------------+------------------------------------+

+-------------------------+---------------------------------------------+----------------------+
| Error code              |    Description                              |HTTP code             |
+=========================+=============================================+======================+
|  DMaaP\_MR\_ERR\_5004   |  Failed to delete topic:<topicName>         |   500                |
+-------------------------+---------------------------------------------+----------------------+

API Inventory
-------------

+-----------+--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           |   API Name         |   API Method                            |   REST API Path                       |                | Comments                         |
+===========+====================+=========================================+=======================================+================+==================================+
| Topics    | GetAll Topics      | getTopics()                             | /topics                               | GET            |                                  |
|           | List               |                                         |                                       |                |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           | Get All Topics     |                                         |                                       |                |                                  |
|           | List with details  | getAllTopics()                          | /topics/listAll                       | GET            |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           | Get individual     |                                         |                                       |                |                                  |
|           | Topic Details      | getTopic(String topicName)              | /topics/{topicName}                   | GET            |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           | Create Topic       | createTopic(TopicBean topicBean)        | /topics/create                        | POST           |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           | Delete Topic       | deleteTopicString topicName)            | /topics/{topicName}                   | DELETE         |  Not used in current MR version  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
|           | Get Publishers     | getPublishersByTopicName                |                                       |                |                                  |
|           | for a Topic        | String topicName)                       | /topics/{topicName}/producers         | GET            |  UEB Backward Compatibility      |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
|           | Add a Publisher    | permitPublisherForTopic                 | /topics/{topicName}/producers/        | PUT            |                                  |
|           | to write ACLon     | (String topicName, String producerId)   | {producerId}                          |                |                                  |
|           | a Topic            |                                         |                                       |                |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
|           | Remove a Publisher | denyPublisherForTopic(String topicName, | /topics/{topicName}/producers/        | DELETE         |                                  |
|           | from write ACL on  | String producerId)                      | {producerId}                          |                |                                  |
|           | a Topic            |                                         |                                       |                |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
|           | Get Consumers for  | getConsumersByTopicName                 | /topics/{topicName}/consumers         |  GET           |                                  |
|           | a Topic            | (String topicName)                      |                                       |                |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
|           | Add a Consumer     | permitConsumerForTopic(String           | /topics/{topicName}/consumers/        |  PUT           |                                  |
|           | to read ACL        | topicName,String consumerId)            | {consumerId}                          |                |                                  |
|           | on a Topic         |                                         |                                       |                |                                  |
|           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
|           | Remove a consumer  | denyPublisherForTopic(String topicName, | /topics/{topicName}/consumers/        | DELETE         |                                  |
|           | from write         | String consumerId)                      | {consumerId}                          |                |                                  |
|           | ACL on a Topic     |                                         |                                       |                |                                  |
+-----------+--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+