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