Fix doc8
[dmaap/messagerouter/messageservice.git] / docs / message-router / message-router.rst
1 ============================================
2 Message Router (MR) API Guide
3 ============================================
4 Architecture
5 -------------
6
7 In DMaaP Message Router, Restful web service is exposed to client to perform any needed action with Kafka. After getting the request it calls the Message router service layer which is created using AJSC ( AT&T Java Service Container) . AJSC finally calls Kafka services and response is sent back.
8
9    |image0|
10
11    .. |image0| image:: image1.png
12
13
14 HTTP Service APIs
15 ------------------
16
17 DMaaP Message Router utilizes an HTTP REST API to service all Publish
18 and Consume transactions. HTTP and REST standards are followed so
19 clients as varied as CURL, Java applications and even Web Browsers will
20 work to interact with Message Router.Message Router uses AAF for user's
21 authentication and authorization.
22
23 General HTTP Requirements
24 =========================
25
26 A DMaaP Message Router transactions consists of 4 distinct segments,
27 HTTP URL, HTTP Header, HTTP Body (POST) and HTTP Response. The general
28 considerations for each segment are as follows and are required for each
29 of the specific transactions described in this section.
30
31 HTTP URL
32 ========
33
34 http[s]://Username:Password@serverBaseURL{/routing}{resourcePath}
35
36 - The Username:Password utilizes HTTP Basic Authentication and HTTPS/TLS to securely transmit the authorization and authentication credentials that AAF needs to validate the client's access to the requested resource.
37
38 - The serverBaseURL points to DMaaP Message Router host/port that will service the request. Optionally DME2 service end points for Message Router can be used.
39
40 - The resourcePath specifies the specific service, or Topic, that the client is attempting to reach
41
42 HTTP Header
43 ===========
44
45 Specifies HTTP Headers, such as Content-Type, that define the parameters
46 of the HTTP Transaction
47
48 HTTP Body
49 =========
50
51 The HTTP Body contains the topic content when Publishing or Consuming.
52 The Body may contain topic messages in several formats (like below) but
53 it must be noted, that, except in very specific circumstances, messages
54 are not inspected for content.
55
56
57 +-------------------------+-----------------------------------------------------------------------------------------------------------------+
58 | Content-Type            |  Description                                                                                                    |
59 +=========================+=================================================================================================================+
60 | text/plain              | Each line in the POST body is treated as a separate message. No partition key is specified, and therefore no    |
61 |                         | order is guaranteed. This format is mainly for test, as messages are highly likely to be re-ordered when        |
62 |                         | delivered through the Kafka cluster.                                                                            |
63 +-------------------------+-----------------------------------------------------------------------------------------------------------------+
64 | application/json        | The payload maybe a single JSON object or a JSON array of JSON objects. Each object is handled as an individual |
65 |                         | message..Note that use of this format may result in equivalent but altered JSON objects sent to consumers.      |
66 |                         | That's because MR uses a standard JSON parser to read each object into memory before pushing the object to the  |
67 |                         | Kafka system. At that point, the JSON object is re-written from the in-memory object. This can result in        |
68 |                         | re-ordered fields or changes in whitespace. If you want to preseve JSON objects exactly,                        |
69 |                         | use application/cambria. Recommended to follow the JSON format.                                                 |
70 +-------------------------+-----------------------------------------------------------------------------------------------------------------+
71
72 Publishers
73 -----------
74
75 **Description**:Publishes data to Kafka server on the topic mentioned in the URL.
76 Messages will be in the request body
77
78 The MessageRouter service has no requirements on what publishers can put
79 onto a topic. The messages are opaque to the service and are treated as
80 raw bytes. In general, passing JSON messages is preferred, but this is
81 due to higher-level features and related systems, not the MessageRouter
82 broker itself. The only constraint placed on messages is their on their
83 size � messages must be under the maximum size, which is currently
84 configured at 1 MB.
85
86 Request URL
87 ===========
88
89 POST http(s)://{HOST:PORT}/events/{topicname}
90
91 Request Parameters
92 ==================
93
94 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
95 | Name               | Description                  | Param Type       | Data type  | Max Len   | Required    | Format                         | Valid/EXample values        |
96 +====================+==============================+==================+============+===========+=============+================================+=============================+
97 | Topicname          | topic name to be posted      | Path             | String     | 40        | Y           |  <app namespace>.<topicname>   | org.onap.crm.empdetails     |
98 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
99 | content-type       | To specify type of message   | Header           | String     | 20        | N           |                                | application/json            |
100 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
101 | Username           | userid                       | Header           | String     |           | N           | Basic Authentication Header    |                             |
102 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
103 | Password           |                              | Header           | String     |           | N           | Basic Authentication Header    |                             |
104 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
105 | partitionKey       |                              | QueryParam       | String     |           | N           | String value                   | ?Partitionkey=123           |
106 +--------------------+------------------------------+------------------+------------+-----------+-------------+--------------------------------+-----------------------------+
107
108 **NOTE**: Publishers/user should have access on the topics. The user (id) and
109 permissions details needs to be in AAF.
110
111 Response Parameters
112 ===================
113
114 +------------------+------------------------+------------+--------------+------------------------------+
115 | Name             | Description            | Type       | Format       | Valid/Example Values         |
116 +==================+========================+============+==============+==============================+
117 | httpStatusCode   |                        |            |              | 200, 201 etc.                |
118 +------------------+------------------------+------------+--------------+------------------------------+
119 | mrErrorCode      | Numeric error code     |            |              | 200, 201 etc.                |
120 +------------------+------------------------+------------+--------------+------------------------------+
121 | errorMessage     |                        |            |              | SUCCESS, or error message.   |
122 +------------------+------------------------+------------+--------------+------------------------------+
123 | helpURL          | helpurl                |            |              |                              |
124 +------------------+------------------------+------------+--------------+------------------------------+
125 | transactionid    | transaction-id value   |            |              |                              |
126 +------------------+------------------------+------------+--------------+------------------------------+
127
128
129
130 Response /Error Codes
131 =====================
132
133 +---------------------------+------------------------------------+
134 | Response statusCode       |  Response statusMessage            |
135 +===========================+====================================+
136 | 200-299                   | Success                            |
137 +---------------------------+------------------------------------+
138 | 400-499                   | the client request has a problem   |
139 +---------------------------+------------------------------------+
140 | 500-599                   | the DMaaP service has a problem    |
141 +---------------------------+------------------------------------+
142
143 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
144 | Error code             |  HTTPCode     |  Description                    | Issue Reason                                                                                            |
145 +========================+===============+=================================+=========================================================================================================+
146 | DMaaP\_MR\_ERR\_3001   | 413           | Request Entity too large        | Message size exceeds the batch limit <limit>.Reduce the batch size and try again                        |
147 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
148 | DMaaP\_MR\_ERR\_3002   | 500           | Internal Server Error           | Unable to publish messages. Please contact administrator                                                |
149 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
150 | DMaaP\_MR\_ERR\_3003   | 400           | Bad Request                     | Incorrect Batching format. Please correct the batching format and try again                             |
151 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
152 | DMaaP\_MR\_ERR\_3004   | 413           | Request Entity too large        | Message size exceeds the message size limit <limit>.Reduce the message size and try again               |
153 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
154 | DMaaP\_MR\_ERR\_3005   | 400           | Bad Request                     | Incorrect JSON object. Please correct the JSON format and try again                                     |
155 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
156 | DMaaP\_MR\_ERR\_3006   | 504           | Network Connect Timeout Error   | Connection to the DMaaP MR was timed out.Please try again                                               |
157 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
158 | DMaaP\_MR\_ERR\_3007   | 500           | Internal Server Error           | Failed to publish  messages to topic <topicName>. Successfully published <count > number of messages.   |
159 +------------------------+---------------+---------------------------------+---------------------------------------------------------------------------------------------------------+
160
161 Sample Request:
162 ===============
163
164 +-----------------------------------------------------------------------------------+
165 | POST                                                                              |
166 |                                                                                   |
167 | *Payload-* *{"message":"message description"}* *Content-Type: application/json*   |
168 |                                                                                   |
169 | Example:                                                                          |
170 |                                                                                   |
171 | curl -u XXXX@abc.com:X -H 'Content-Type:text/plain' -X POST -d @sampleMsg.txt     |
172 |                                                                                   |
173 | {    "count": 1,                                                                  |
174 |                                                                                   |
175 |     "serverTimeMs": 19"                                                           |
176 |                                                                                   |
177 | }                                                                                 |
178 +-----------------------------------------------------------------------------------+
179
180 Sample Response:
181 ================
182
183 +---------------------------------------------------------------------+
184 | HTTP/1.1 200 OK                                                     |
185 |                                                                     |
186 |     Server: Apache-Coyote/1.1                                       |
187 |                                                                     |
188 |     transactionId: 28-12-2015::08:18:50:682::<IP>::28122015552391   |
189 |                                                                     |
190 |     Content-Type: application/json                                  |
191 |                                                                     |
192 |     Content-Length: 42                                              |
193 |                                                                     |
194 |     Date: Mon, 28 Dec 2015 13:18:50 GMT                             |
195 +---------------------------------------------------------------------+
196
197
198
199 Subscribers
200 -----------
201 **Description**:To subscribe to a MessageRouter topic, a subscriber issues a GET to the RESTful HTTP endpoint for events.
202
203 Request URL:
204 ============
205
206 GET http(s)://{HOST:PORT}}/events/{topicname}/{consumegroup}/{consumerid}/{timeout=x}
207
208 Request Parameters:
209 ===================
210
211 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
212 | Name         | Description                     |  Param Type      |  data type |   MaxLen     |  Required   |  Format             |  Valid/Example Values  |
213 +==============+=================================+==================+============+==============+=============+=====================+========================+
214 | Topicname    | topic name to be posted         |     Path         |   String   |    40        |     Y       | namespace.String    |                        |
215 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
216 | Consumer     | A name that uniquely identifies |     Path         |   String   |              |     Y       |                     | CG1                    |
217 | group        | your subscribers                |                  |            |              |             |                     |                        |
218 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
219 | consumerId   | Within your subscribers group,  |     Path         |   String   |              |     Y       |                     | C1                     |
220 |              | a name that uniquely identifies |                  |            |              |             |                     |                        |
221 |              | your subscribers  process       |                  |            |              |             |                     |                        |
222 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
223 | content-type | To specify type of message      |     Header       |   String   |     20       |     N       |                     | aplication/json        |
224 |              | content(json,text or cambria)   |                  |            |              |             |                     |                        |
225 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
226 | Username     | userid                          |     Header       |   String   |     1        |     N       |                     |                        |
227 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
228 | Password     |                                 |     Header       |   String   |     1        |     N       |                     |                        |
229 +--------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+------------------------+
230
231 **NOTE1**:Subscribers /user should have access on the topics. The user () and
232 permissions details needs to be in AAF.
233
234 Response Parameters:
235 ====================
236
237 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
238 | Name             | Description                    |  Type      | Format       | Valid/Example Values                                      |
239 +==================+================================+============+==============+===========================================================+
240 | httpStatusCode   |                                |            |              | 200, 201 etc.                                             |
241 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
242 | mrErrorCode      | Numeric error code             |            |              | 200, 201 etc.                                             |
243 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
244 | errorMessage     |                                |            |              | SUCCESS, or error message.                                |
245 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
246 | helpURL          | helpurl                        |            |              |                                                           |
247 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
248 | tranactionid     | transaction-id value           |            |              | 28-12-2015::08:18:50:682::135.25.227.66::28122015552391   |
249 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
250 | ResponseBody     | Messages consumed from topic   | Json       | Json         |                                                           |
251 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
252
253
254 Response /Error Codes
255 =====================
256
257
258 +---------------------------+------------------------------------+
259 | Response statusCode       | Response statusMessage             |
260 +===========================+====================================+
261 | 200-299                   | Success                            |
262 +---------------------------+------------------------------------+
263 | 400-499                   | the client request has a problem   |
264 +---------------------------+------------------------------------+
265 | 500-599                   | the DMaaP service has a problem    |
266 +---------------------------+------------------------------------+
267
268 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
269 | Error code              |  HTTPCode       |  Description               | Issue Reason                                                                                |
270 +=========================+=================+============================+=============================================================================================+
271 | DMaaP\_MR\_ERR\_3008    | 413             | Request Entity too large   | Message size exceeds the batch limit <limit>.Reduce the batch size and try again            |
272 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
273 | DMaaP\_MR\_ERR\_3009    | 500             | Internal Server Error      | Unable to publish messages. Please contact administartor                                    |
274 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
275 | DMaaP\_MR\_ERR\_3010    | 400             | Bad Request                | Incorrect Batching format. Please correct the batching format and try again                 |
276 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
277 | DMaaP\_MR\_ERR\_3011    | 413             | Request Entity too large   | Message size exceeds the message size limit <limit>.Reduce the message size and try again   |
278 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
279 | DMaaP\_MR\_ERR\_5012    | 429             | Too many requests          | This client is making too many requests. Please use a long poll setting to decrease the     |
280 |                         |                 |                            | number of requests that result in empty responses.                                          |
281 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
282 |                         | 503             | Service Unavailable        | Service Unavailable.                                                                        |
283 +-------------------------+-----------------+----------------------------+---------------------------------------------------------------------------------------------+
284
285 Sample Request:
286 ===============
287
288 +----------------------------------------------------------------------------------------------------+
289 | GET  http://<hostname>:3904/events/com.att.dmaap.mr.sprint/mygroup/mycus                           |
290 |                                                                                                    |
291 | Content-Type: application/json                                                                     |
292 |                                                                                                    |
293 | Example:                                                                                           |
294 |                                                                                                    |
295 |curl -u XXX@csp.abc.com:MRDmap2016$ -X GET -d 'MyfirstMessage'                                      |
296 |                                                                                                    |
297 |http://mrlocal00.dcae.proto.research.att.com:3904/events/com.att.ecomp_test.crm.preDeo/myG/C1       |
298 |                                                                                                    |
299 |[I am r sending first msg,I am R sending first msg]                                                 |
300 +----------------------------------------------------------------------------------------------------+
301
302 Provisioning
303 ------------
304 **Description**: To create , modify or delete the MessageRouter topics. Generally Invenio application will use these  below apis to create , assign topics to the users. These APIs can also be used by other applications to provision topics in MessageRouter
305
306 Create Topic
307 ============
308 Request URL:
309 ============
310
311 POST http(s)://{HOST:PORT}/topics/create
312
313 Request Parameters:
314 ===================
315
316 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
317 | Name              | Description                     |  Param Type      |  datatype  |   MaxLen     |  Required   |  Format     |  Valid/Example Values             |
318 +===================+=================================+==================+============+==============+=============+=============+===================================+
319 | Topicname         | topicname to be created in MR   |     Body         |   String   |     20       |     Y       | Json        | com.att.dmaap.mr.metrics          |
320 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
321 | topicDescription  | description for topic           |     Body         |   String   |     15       |     Y       |             |                                   |
322 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
323 | partitionCount    | Kafka topic partition           |     Body         |   String   |     1        |    Y        |             |                                   |
324 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
325 | replicationCount  | Kafka topic replication         |     Body         |   String   |     1        |    Y        |             | 3 (Default -for 3 node Kafka )    |
326 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
327 | transaction       | to create transaction id for    |     Body         |  Boolean   |     1        |    N        |             | true                              |
328 | Enabled           | each message transaction        |                  |            |              |             |             |                                   |
329 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
330 | Content-Type      | application/json                |     Header       |   String   |              |             |             | application/json                  |
331 +-------------------+---------------------------------+------------------+------------+--------------+-------------+-------------+-----------------------------------+
332
333 +---------------------------+------------------------------------+
334 | Response statusCode       | Response statusMessage             |
335 +===========================+====================================+
336 | 200-299                   | Success                            |
337 +---------------------------+------------------------------------+
338 | 400-499                   | the client request has a problem   |
339 +---------------------------+------------------------------------+
340 | 500-599                   | the DMaaP service has a problem    |
341 +---------------------------+------------------------------------+
342
343
344 +-------------------------+-----------------+--------------------------------------------------+
345 | Error code              |  HTTP Code      |  Description                                     |
346 +=========================+=================+==================================================+
347 | DMaaP\_MR\_ERR\_5001    | 500             | Failed to retrieve list of all topics            |
348 +-------------------------+-----------------+--------------------------------------------------+
349 | DMaaP\_MR\_ERR\_5002    | 500             | Failed to retrieve details of topic:<topicName>  |
350 +-------------------------+-----------------+--------------------------------------------------+
351 | DMaaP\_MR\_ERR\_5003    | 500             | Failed to create topic:<topicName>               |
352 +-------------------------+-----------------+--------------------------------------------------+
353 | DMaaP\_MR\_ERR\_5004    | 500             | Failed to delete topic:<topicName>               |
354 +-------------------------+-----------------+--------------------------------------------------+
355
356
357 Response Parameters
358 ====================
359
360 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
361 | Name             | Description                    |  Type      | Format       | Valid/Example Values                                      |
362 +==================+================================+============+==============+===========================================================+
363 | httpStatusCode   |                                |            |              | 200, 201 etc.                                             |
364 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
365 | mrErrorCode      | Numeric error code             |            |              | 5005                                                      |
366 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
367 | errorMessage     |                                |            |              | SUCCESS, or error message.                                |
368 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
369 | helpURL          | helpurl                        |            |              |                                                           |
370 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
371 | ResponseBody     | Topic details (owner,          |  Json      |  Json        |                                                           |
372 |                  | trxEnabled=true)               |            |              |                                                           |
373 +------------------+--------------------------------+------------+--------------+-----------------------------------------------------------+
374
375
376 Sample Request:
377 ===============
378
379     .. code:: bash
380
381       POST   http://<hostname>:3904/topic/create
382   Request Body
383   {"topicName":"com.abc.dmaap.mr.topicname","description":"This is a SAPTopic ",
384   "partitionCount":"1","replicationCount":"3","transactionEnabled":"true"}
385   Content-Type: application/json
386   Example:
387   curl -u XXXc@csp.abc.com:xxxxx$  -H 'Content-Type:application/json' -X POST -d
388   @topicname.txt  http://mrlocal00.dcae.proto.research.abc.com:3904/topics/create
389   {
390   "writerAcl": {
391   "enabled": false,
392   "users": []
393   },
394   "description": "This is a TestTopic",
395   "name": "com.abc.ecomp_test.crm.Load9",
396   "readerAcl": {
397   "enabled": false,
398   "users": []
399
400
401 GetTopic Details
402 ----------------
403
404 Request URL
405 ===========
406
407 GET http(s)://{HOST:PORT}/topics    : To list the details of all the topics in Message Router.
408
409 GET http(s)://{HOST:PORT}/topics/{topicname} : To list the details of specified topic .
410
411 Request Parameters
412 ==================
413
414 +--------------------------+-------------------------+------------------+------------+-----------+-------------+-----------------+-----------------------------+
415 | Name                     | Description             | Param Type       | Data type  | Max Len   | Required    | Format          | Valid/EXample values        |
416 +==========================+=========================+==================+============+===========+=============+=================+=============================+
417 | Topicname                | topic name details      | Body             | String     | 20        | Y           |  Json           | com.abc.dmaap.mr.metrics    |
418 +--------------------------+-------------------------+------------------+------------+-----------+-------------+-----------------+-----------------------------+
419
420
421 Response Parameters
422 ====================
423
424 +------------------+------------------------+------------+----------+---------+--------------------------+
425 | Name             | Description            | ParamType  | datatype |Format   | Valid/Example Values     |
426 +==================+========================+============+==========+=========+==========================+
427 | topicname        |  topic name details    |      Body  |   String |   Json  | com.abc.dmaap.mr.metrics |
428 +------------------+------------------------+------------+----------+---------+--------------------------+
429 | description      |                        |            |   String |         |                          |
430 +------------------+------------------------+------------+----------+---------+--------------------------+
431 | owner            |user id who created the |            |          |         |                          |
432 |                  |         topic          |            |          |         |                          |
433 +------------------+------------------------+------------+----------+---------+--------------------------+
434 | txenabled        |     true or false      |            |  boolean |         |                          |
435 +------------------+------------------------+------------+----------+---------+--------------------------+
436
437 +---------------------------+------------------------------------+
438 | Response statusCode       | Response statusMessage             |
439 +===========================+====================================+
440 | 200-299                   | Success                            |
441 +---------------------------+------------------------------------+
442 | 400-499                   | the client request has a problem   |
443 +---------------------------+------------------------------------+
444 | 500-599                   | the DMaaP service has a problem    |
445 +---------------------------+------------------------------------+
446
447
448 Sample Request:
449 ===============
450
451 +-----------------------------------------------------------------------------------------------------------------------------------+
452 | GET   http://<hostname>:3904/topic/com.att.dmaap.mr.testtopic                                                                     |
453 |       curl -u XXX@csp.abc.com:x$  -X                                                                                              |
454 | GET  http://mrlocal00.dcae.proto.research.att.com:3904/topics                                                                     |
455 |    {"topics": [                                                                                                                   |
456 |    {"txenabled": true,"description": "This is a TestTopic","owner": "XXXX@csp.abc.com","topicName": "com.abc.ecomp_test.crm.Load9"|
457 |    {"txenabled": false,"description": "", "owner": "", "topicName": "com.abc.ecomp_test.crm.Load1"                                |
458 |    ]},                                                                                                                            |
459 +-----------------------------------------------------------------------------------------------------------------------------------+
460
461
462 Delete Topics
463 -------------
464
465 Request URL:
466 ============
467
468 DELETE http(s)://{HOST:PORT}/topic/{topicname}
469
470 Sample Request:
471 ===============
472 ex: http://<hostname>:3904/dmaap/v1/topics/com.att.dmaap.mr.testopic
473
474 +---------------------------+------------------------------------+
475 | Response statusCode       | Response statusMessage             |
476 +===========================+====================================+
477 | 200-299                   | Success                            |
478 +---------------------------+------------------------------------+
479 | 400-499                   | the client request has a problem   |
480 +---------------------------+------------------------------------+
481 | 500-599                   | the DMaaP service has a problem    |
482 +---------------------------+------------------------------------+
483
484 +-------------------------+---------------------------------------------+----------------------+
485 | Error code              |    Description                              |HTTP code             |
486 +=========================+=============================================+======================+
487 |  DMaaP\_MR\_ERR\_5004   |  Failed to delete topic:<topicName>         |   500                |
488 +-------------------------+---------------------------------------------+----------------------+
489
490 API Inventory
491 -------------
492
493 +-----------+--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
494 |           |   API Name         |   API Method                            |   REST API Path                       |                | Comments                         |
495 +===========+====================+=========================================+=======================================+================+==================================+
496 | Topics    | GetAll Topics      | getTopics()                             | /topics                               | GET            |                                  |
497 |           | List               |                                         |                                       |                |                                  |
498 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
499 |           | Get All Topics     |                                         |                                       |                |                                  |
500 |           | List with details  | getAllTopics()                          | /topics/listAll                       | GET            |                                  |
501 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
502 |           | Get individual     |                                         |                                       |                |                                  |
503 |           | Topic Details      | getTopic(String topicName)              | /topics/{topicName}                   | GET            |                                  |
504 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
505 |           | Create Topic       | createTopic(TopicBean topicBean)        | /topics/create                        | POST           |                                  |
506 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
507 |           | Delete Topic       | deleteTopicString topicName)            | /topics/{topicName}                   | DELETE         |  Not used in current MR version  |
508 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+
509 |           | Get Publishers     | getPublishersByTopicName                |                                       |                |                                  |
510 |           | for a Topic        | String topicName)                       | /topics/{topicName}/producers         | GET            |  UEB Backward Compatibility      |
511 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
512 |           | Add a Publisher    | permitPublisherForTopic                 | /topics/{topicName}/producers/        | PUT            |                                  |
513 |           | to write ACLon     | (String topicName, String producerId)   | {producerId}                          |                |                                  |
514 |           | a Topic            |                                         |                                       |                |                                  |
515 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
516 |           | Remove a Publisher | denyPublisherForTopic(String topicName, | /topics/{topicName}/producers/        | DELETE         |                                  |
517 |           | from write ACL on  | String producerId)                      | {producerId}                          |                |                                  |
518 |           | a Topic            |                                         |                                       |                |                                  |
519 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
520 |           | Get Consumers for  | getConsumersByTopicName                 | /topics/{topicName}/consumers         |  GET           |                                  |
521 |           | a Topic            | (String topicName)                      |                                       |                |                                  |
522 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
523 |           | Add a Consumer     | permitConsumerForTopic(String           | /topics/{topicName}/consumers/        |  PUT           |                                  |
524 |           | to read ACL        | topicName,String consumerId)            | {consumerId}                          |                |                                  |
525 |           | on a Topic         |                                         |                                       |                |                                  |
526 |           +--------------------+-----------------------------------------+---------------------------------------+----------------+                                  |
527 |           | Remove a consumer  | denyPublisherForTopic(String topicName, | /topics/{topicName}/consumers/        | DELETE         |                                  |
528 |           | from write         | String consumerId)                      | {consumerId}                          |                |                                  |
529 |           | ACL on a Topic     |                                         |                                       |                |                                  |
530 +-----------+--------------------+-----------------------------------------+---------------------------------------+----------------+----------------------------------+