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