Replace ATT headers
[dmaap/datarouter.git] / docs / data-router / data-router.rst
1 .. _data_router_api_guide:\r
2 \r
3 ==========================\r
4 Data Router (DR) API Guide\r
5 ==========================\r
6 Introduction\r
7 ------------\r
8 \r
9 The DataRouter(DR) provisioning API is an HTTPS-based, REST-like API for creating and managing DR feeds\r
10 and subscriptions. The DMaaP Data Router System project is intended to provide a common framework by which\r
11 data producers can make data available to data consumers and a way for potential consumers to find feeds\r
12 with the data they require.\r
13 \r
14 \r
15 HTTP Service APIs\r
16 -----------------\r
17 \r
18 DMaaP Data Router utilizes an HTTP REST API to service all transactions. HTTP and REST standards are followed so\r
19 clients as varied as CURL, Java applications and even Web Browsers will work to interact with the Data Router.\r
20 \r
21 General HTTP Requirements\r
22 =========================\r
23 \r
24 A DMaaP Data Router transactions consists of 4 distinct segments, HTTP URL, HTTP Header, HTTP Body (POST/PUT)\r
25 and HTTP Response. The general considerations for each segment are as follows and are required for each\r
26 of the specific transactions described in this section.\r
27 \r
28 HTTP URL\r
29 ========\r
30 \r
31 http[s]://{serverBaseURL}/{resourcePath}\r
32 \r
33 * The serverBaseURL points to DMaaP Data Router host:port that will service the request.\r
34 * The resourcePath specifies the service that the client is attempting to reach.\r
35 \r
36 \r
37 HTTP Header\r
38 ===========\r
39 \r
40 Specifies HTTP Headers, such as Content-Type, that define the parameters of the HTTP Transaction\r
41 \r
42 HTTP Body\r
43 =========\r
44 \r
45 The HTTP Body contains the feed content when creating a feed.\r
46 \r
47 Create a Feed\r
48 -------------\r
49 \r
50 **Description**: Creates a unique feed URL to service the publisher/subscriber model.\r
51 \r
52 Sample Request\r
53 ==============\r
54 \r
55 ``curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @createFeed.json https://{host}:{port}``\r
56 \r
57 Request Parameters:\r
58 ===================\r
59 \r
60 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
61 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
62 +========================+=================================+==================+============+==============+=============+======================================+\r
63 | name                   | Feed name                       |     Body         |   String   |    <=20      |     Y       |                                      |\r
64 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
65 | version                | Feed version                    |     Body         |   String   |    <=20      |     Y       |                                      |\r
66 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
67 | description            | Feed description                |     Body         |   String   |    <=256     |     Y       |                                      |\r
68 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
69 | business description   | Business description            |     Body         |   String   |    <=256     |     Y       |                                      |\r
70 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
71 | Authorization          | Information for authorizing     |     Body         |   Object   |              |     Y       |                                      |\r
72 |                        | publishing requests             |                  |            |              |             |                                      |\r
73 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
74 | suspend                | Set to true if the feed is in   |     Body         |   Boolean  |              |     N       | * true                               |\r
75 |                        | the suspended state             |                  |            |              |             | * false                              |\r
76 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
77 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                                      |\r
78 |                        |                                 |                  |            |              |             |                                      |\r
79 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
80 | content-type           | To specify type of message      |     Header       |   String   |              |     Y       | application/vnd.dmaap-dr.feed        |\r
81 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                                      |\r
82 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
83 | X-DMAAP-DR-ON-BEHALF-OF| User id of owner of feed        |     Header       |   String   |     <=8      |     Y       |  username                            |\r
84 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
85 \r
86 Response/Error Codes\r
87 ====================\r
88 \r
89 +------------------------+-------------------------------------------+\r
90 | Response statusCode    | Response Description                      |\r
91 +========================+===========================================+\r
92 | 201                    | Successful query                          |\r
93 +------------------------+-------------------------------------------+\r
94 | 400                    | Bad request - The request is defective in |\r
95 |                        | some way. Possible causes:                |\r
96 |                        |                                           |\r
97 |                        | * JSON object in request body does not    |\r
98 |                        |   conform to the spec.                    |\r
99 |                        | * Invalid parameter value in query string |\r
100 +------------------------+-------------------------------------------+\r
101 | 401                    | Indicates that the request was missing the|\r
102 |                        | Authorization header or, if the header    |\r
103 |                        | was presented, the credentials were not   |\r
104 |                        | acceptable                                |\r
105 +------------------------+-------------------------------------------+\r
106 | 403                    | The request failed authorization.         |\r
107 |                        | Possible causes:                          |\r
108 |                        |                                           |\r
109 |                        | * Request originated from an unauthorized |\r
110 |                        |   IP address                              |\r
111 |                        | * Client certificate subject is not on    |\r
112 |                        |   the API’s authorized list.              |\r
113 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
114 |                        |   authorized to perform                   |\r
115 +------------------------+-------------------------------------------+\r
116 | 404                    | Not Found - The Request-URI does not point|\r
117 |                        | to a resource that is known to the API.   |\r
118 +------------------------+-------------------------------------------+\r
119 | 405                    | Method Not Allowed - The HTTP method in   |\r
120 |                        | the request is not supported for the      |\r
121 |                        | resource addressed by the Request-URI.    |\r
122 +------------------------+-------------------------------------------+\r
123 | 415                    | Unsupported Media Type - The media type in|\r
124 |                        | the requests Content-Type header is not   |\r
125 |                        | appropriate for the request.              |\r
126 +------------------------+-------------------------------------------+\r
127 | 500                    | Internal Server Error - The DR API server |\r
128 |                        | encountered an internal error and could   |\r
129 |                        | not complete the request.                 |\r
130 +------------------------+-------------------------------------------+\r
131 | 503                    | Service Unavailable - The DR API service  |\r
132 |                        | is currently unavailable                  |\r
133 +------------------------+-------------------------------------------+\r
134 | -1                     | Failed Delivery                           |\r
135 +------------------------+-------------------------------------------+\r
136 \r
137 Sample Body\r
138 ===========\r
139 .. code-block:: json\r
140 \r
141  {\r
142      "name": "Jettydemo",\r
143      "version": "v1.0.0",\r
144      "description": "Jettydemo",\r
145      "business_description": "Jettydemo",\r
146      "suspend": false,\r
147      "changeowner": true,\r
148      "authorization": {\r
149           "classification": "unclassified",\r
150           "endpoint_addrs": ["172.18.0.3","192.167.3.42"],\r
151           "endpoint_ids": [\r
152                {\r
153                     "password": "password",\r
154                     "id": "user"\r
155                }\r
156           ]\r
157      }\r
158  }\r
159 \r
160 \r
161 Updating a Feed\r
162 ---------------\r
163 \r
164 **Description**: Update a feed with new parameters.\r
165 \r
166 Sample Request\r
167 ==============\r
168 \r
169 ``curl -k -X PUT -H "Content-Type: application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" --data-ascii @updateFeed.json --location-trusted https://{host}:{port}/feed/{feedId}``\r
170 \r
171 Request Parameters:\r
172 ===================\r
173 \r
174 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
175 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
176 +========================+=================================+==================+============+==============+=============+======================================+\r
177 | description            | Feed description                |     Body         |   String   |     <=256    |     Y       |                                      |\r
178 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
179 | business description   | Business description            |     Body         |   String   |     <=256    |     Y       |                                      |\r
180 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
181 | Authorization          | Information for authorizing     |     Body         |   Object   |              |     Y       |                                      |\r
182 |                        | publishing requests             |                  |            |              |             |                                      |\r
183 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
184 | suspend                | Set to true if the feed is in   |     Body         |   Boolean  |              |     N       | * true                               |\r
185 |                        | the suspended state             |                  |            |              |             | * false                              |\r
186 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
187 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                                      |\r
188 |                        |                                 |                  |            |              |             |                                      |\r
189 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
190 | content-type           | To specify type of message      |     Header       |   String   |              |     Y       | application/vnd.dmaap-dr.feed        |\r
191 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                                      |\r
192 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
193 | X-DMAAP-DR-ON-BEHALF-OF| User id of owner of feed        |     Header       |   String   |     <=8      |     Y       |  username                            |\r
194 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
195 \r
196 Response/Error Codes\r
197 ====================\r
198 \r
199 +------------------------+-------------------------------------------+\r
200 | Response statusCode    | Response Description                      |\r
201 +========================+===========================================+\r
202 | 200                    | Successful query                          |\r
203 +------------------------+-------------------------------------------+\r
204 | 400                    | Bad request - The request is defective in |\r
205 |                        | some way. Possible causes:                |\r
206 |                        |                                           |\r
207 |                        | * JSON object in request body does not    |\r
208 |                        |   conform to the spec.                    |\r
209 |                        | * Invalid parameter value in query string |\r
210 +------------------------+-------------------------------------------+\r
211 | 401                    | Indicates that the request was missing the|\r
212 |                        | Authorization header or, if the header    |\r
213 |                        | was presented, the credentials were not   |\r
214 |                        | acceptable                                |\r
215 +------------------------+-------------------------------------------+\r
216 | 403                    | The request failed authorization.         |\r
217 |                        | Possible causes:                          |\r
218 |                        |                                           |\r
219 |                        | * Request originated from an unauthorized |\r
220 |                        |   IP address                              |\r
221 |                        | * Client certificate subject is not on    |\r
222 |                        |   the API’s authorized list.              |\r
223 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
224 |                        |   authorized to perform                   |\r
225 +------------------------+-------------------------------------------+\r
226 | 404                    | Not Found - The Request-URI does not point|\r
227 |                        | to a resource that is known to the API.   |\r
228 +------------------------+-------------------------------------------+\r
229 | 405                    | Method Not Allowed - The HTTP method in   |\r
230 |                        | the request is not supported for the      |\r
231 |                        | resource addressed by the Request-URI.    |\r
232 +------------------------+-------------------------------------------+\r
233 | 415                    | Unsupported Media Type - The media type in|\r
234 |                        | the request’s Content-Type header is not  |\r
235 |                        | appropriate for the request.              |\r
236 +------------------------+-------------------------------------------+\r
237 | 500                    | Internal Server Error - The DR API server |\r
238 |                        | encountered an internal error and could   |\r
239 |                        | not complete the request.                 |\r
240 +------------------------+-------------------------------------------+\r
241 | 503                    | Service Unavailable - The DR API service  |\r
242 |                        | is currently unavailable                  |\r
243 +------------------------+-------------------------------------------+\r
244 | -1                     | Failed Delivery                           |\r
245 +------------------------+-------------------------------------------+\r
246 \r
247 Sample Body\r
248 ===========\r
249 .. code-block:: json\r
250 \r
251  {\r
252      "name": "Jettydemo",\r
253      "version": "v1.0.0",\r
254      "description": "Updated decription",\r
255      "business_description": "Updated business description",\r
256      "suspend": false,\r
257      "changeowner": true,\r
258      "authorization": {\r
259           "classification": "unclassified",\r
260           "endpoint_addrs": ["172.18.0.3","192.167.3.42"],\r
261           "endpoint_ids": [\r
262                {\r
263                     "password": "password",\r
264                     "id": "user"\r
265                }\r
266           ]\r
267      }\r
268  }\r
269 \r
270 \r
271 Get a Feed\r
272 ----------\r
273 \r
274 **Description**: Retrieves a representation of the specified feed.\r
275 \r
276 Request URL\r
277 ===========\r
278 \r
279 http[s]://{host}:{port}/feed/{feedId}\r
280 \r
281 * {feedId}: Id of the feed you want to see a representation of\r
282 \r
283 Sample Request\r
284 ==============\r
285 \r
286 ``curl -k -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
287 \r
288 Response/Error Codes\r
289 ====================\r
290 \r
291 +------------------------+-------------------------------------------+\r
292 | Response statusCode    | Response Description                      |\r
293 +========================+===========================================+\r
294 | 200                    | Successful query                          |\r
295 +------------------------+-------------------------------------------+\r
296 | 401                    | Indicates that the request was missing the|\r
297 |                        | Authorization header or, if the header    |\r
298 |                        | was presented, the credentials were not   |\r
299 |                        | acceptable                                |\r
300 +------------------------+-------------------------------------------+\r
301 | 403                    | The request failed authorization.         |\r
302 |                        | Possible causes:                          |\r
303 |                        |                                           |\r
304 |                        | * Request originated from an unauthorized |\r
305 |                        |   IP address                              |\r
306 |                        | * Client certificate subject is not on    |\r
307 |                        |   the API’s authorized list.              |\r
308 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
309 |                        |   authorized to perform                   |\r
310 +------------------------+-------------------------------------------+\r
311 | 404                    | Not Found - The Request-URI does not point|\r
312 |                        | to a resource that is known to the API.   |\r
313 +------------------------+-------------------------------------------+\r
314 | 405                    | Method Not Allowed - The HTTP method in   |\r
315 |                        | the request is not supported for the      |\r
316 |                        | resource addressed by the Request-URI.    |\r
317 +------------------------+-------------------------------------------+\r
318 | 415                    | Unsupported Media Type - The media type in|\r
319 |                        | the request’s Content-Type header is not  |\r
320 |                        | appropriate for the request.              |\r
321 +------------------------+-------------------------------------------+\r
322 | 500                    | Internal Server Error - The DR API server |\r
323 |                        | encountered an internal error and could   |\r
324 |                        | not complete the request.                 |\r
325 +------------------------+-------------------------------------------+\r
326 | 503                    | Service Unavailable - The DR API service  |\r
327 |                        | is currently unavailable                  |\r
328 +------------------------+-------------------------------------------+\r
329 | -1                     | Failed Delivery                           |\r
330 +------------------------+-------------------------------------------+\r
331 \r
332 Delete a Feed\r
333 -------------\r
334 \r
335 **Description**: Deletes a specified feed\r
336 \r
337 Request URL\r
338 ===========\r
339 \r
340 http[s]://{host}:{port}/feed/{feedId}\r
341 \r
342 * {feedId}: Id of the feed you want to delete\r
343 \r
344 Sample Request\r
345 ==============\r
346 \r
347 ``curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
348 \r
349 Response/Error Codes\r
350 ====================\r
351 \r
352 +------------------------+-------------------------------------------+\r
353 | Response statusCode    | Response Description                      |\r
354 +========================+===========================================+\r
355 | 204                    | Successful query                          |\r
356 +------------------------+-------------------------------------------+\r
357 | 401                    | Indicates that the request was missing the|\r
358 |                        | Authorization header or, if the header    |\r
359 |                        | was presented, the credentials were not   |\r
360 |                        | acceptable                                |\r
361 +------------------------+-------------------------------------------+\r
362 | 403                    | The request failed authorization.         |\r
363 |                        | Possible causes:                          |\r
364 |                        |                                           |\r
365 |                        | * Request originated from an unauthorized |\r
366 |                        |   IP address                              |\r
367 |                        | * Client certificate subject is not on    |\r
368 |                        |   the API’s authorized list.              |\r
369 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
370 |                        |   authorized to perform                   |\r
371 +------------------------+-------------------------------------------+\r
372 | 404                    | Not Found - The Request-URI does not point|\r
373 |                        | to a resource that is known to the API.   |\r
374 +------------------------+-------------------------------------------+\r
375 | 405                    | Method Not Allowed - The HTTP method in   |\r
376 |                        | the request is not supported for the      |\r
377 |                        | resource addressed by the Request-URI.    |\r
378 +------------------------+-------------------------------------------+\r
379 | 415                    | Unsupported Media Type - The media type in|\r
380 |                        | the request’s Content-Type header is not  |\r
381 |                        | appropriate for the request.              |\r
382 +------------------------+-------------------------------------------+\r
383 | 500                    | Internal Server Error - The DR API server |\r
384 |                        | encountered an internal error and could   |\r
385 |                        | not complete the request.                 |\r
386 +------------------------+-------------------------------------------+\r
387 | 503                    | Service Unavailable - The DR API service  |\r
388 |                        | is currently unavailable                  |\r
389 +------------------------+-------------------------------------------+\r
390 | -1                     | Failed Delivery                           |\r
391 +------------------------+-------------------------------------------+\r
392 \r
393 \r
394 Subscribe to Feed\r
395 -----------------\r
396 \r
397 **Description**: Subscribes to a created feed to receive files published to that feed.\r
398 \r
399 Request URL\r
400 ===========\r
401 \r
402 http[s]://{host}:{port}/subscribe/{feedId}\r
403 \r
404 * {feedId}: Id of the feed to subscribe to\r
405 \r
406 Sample Request\r
407 ==============\r
408 \r
409 ``curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @addSubscriber.json https://{host}:{port}/subscribe/{feedId}``\r
410 \r
411 Request Parameters:\r
412 ===================\r
413 \r
414 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
415 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
416 +========================+=================================+==================+============+==============+=============+======================================+\r
417 | feedId                 | ID for the feed you are         |     Path         |   String   |              |     Y       |                                      |\r
418 |                        | subscribing to                  |                  |            |              |             |                                      |\r
419 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
420 | delivery               | Address and credentials for     |     Body         |   Object   |              |     Y       |                                      |\r
421 |                        | delivery                        |                  |            |              |             |                                      |\r
422 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
423 | follow_redirect        | Set to true if feed redirection |     Body         |   Boolean  |              |     Y       | * true                               |\r
424 |                        | is expected                     |                  |            |              |             | * false                              |\r
425 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
426 | metadata_only          | Set to true if subscription is  |     Body         |   Boolean  |              |     Y       | * true                               |\r
427 |                        | to receive per-file metadata    |                  |            |              |             | * false                              |\r
428 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
429 | suspend                | Set to true if the subscription |     Body         |   Boolean  |              |     N       | * true                               |\r
430 |                        | is in the suspended state       |                  |            |              |             | * false                              |\r
431 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
432 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                                      |\r
433 |                        |                                 |                  |            |              |             |                                      |\r
434 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
435 | content-type           | To specify type of message      |     Header       |   String   |              |     Y       | application/vnd.dmaap-dr.subscription|\r
436 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                                      |\r
437 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
438 | X-DMAAP-DR-ON-BEHALF-OF| User id of subscriber           |     Header       |   String   |     <=8      |     Y       |  username                            |\r
439 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
440 \r
441 Response/Error Codes\r
442 ====================\r
443 \r
444 +------------------------+-------------------------------------------+\r
445 | Response statusCode    | Response Description                      |\r
446 +========================+===========================================+\r
447 | 201                    | Successful query                          |\r
448 +------------------------+-------------------------------------------+\r
449 | 400                    | Bad request - The request is defective in |\r
450 |                        | some way. Possible causes:                |\r
451 |                        |                                           |\r
452 |                        | * JSON object in request body does not    |\r
453 |                        |   conform to the spec.                    |\r
454 |                        | * Invalid parameter value in query string |\r
455 +------------------------+-------------------------------------------+\r
456 | 401                    | Indicates that the request was missing the|\r
457 |                        | Authorization header or, if the header    |\r
458 |                        | was presented, the credentials were not   |\r
459 |                        | acceptable                                |\r
460 +------------------------+-------------------------------------------+\r
461 | 403                    | The request failed authorization.         |\r
462 |                        | Possible causes:                          |\r
463 |                        |                                           |\r
464 |                        | * Request originated from an unauthorized |\r
465 |                        |   IP address                              |\r
466 |                        | * Client certificate subject is not on    |\r
467 |                        |   the API’s authorized list.              |\r
468 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
469 |                        |   authorized to perform                   |\r
470 +------------------------+-------------------------------------------+\r
471 | 404                    | Not Found - The Request-URI does not point|\r
472 |                        | to a resource that is known to the API.   |\r
473 +------------------------+-------------------------------------------+\r
474 | 405                    | Method Not Allowed - The HTTP method in   |\r
475 |                        | the request is not supported for the      |\r
476 |                        | resource addressed by the Request-URI.    |\r
477 +------------------------+-------------------------------------------+\r
478 | 415                    | Unsupported Media Type - The media type in|\r
479 |                        | the requests Content-Type header is not   |\r
480 |                        | appropriate for the request.              |\r
481 +------------------------+-------------------------------------------+\r
482 | 500                    | Internal Server Error - The DR API server |\r
483 |                        | encountered an internal error and could   |\r
484 |                        | not complete the request.                 |\r
485 +------------------------+-------------------------------------------+\r
486 | 503                    | Service Unavailable - The DR API service  |\r
487 |                        | is currently unavailable                  |\r
488 +------------------------+-------------------------------------------+\r
489 | -1                     | Failed Delivery                           |\r
490 +------------------------+-------------------------------------------+\r
491 \r
492 Sample Body\r
493 ===========\r
494 .. code-block:: json\r
495 \r
496  {\r
497     "delivery" :{\r
498         "url" : "http://172.18.0.3:7070/",\r
499         "user" : "LOGIN",\r
500         "password" : "PASSWORD",\r
501         "use100" : true\r
502     },\r
503     "metadataOnly" : false,\r
504     "groupid" : 1,\r
505     "subscriber" : "subuser"\r
506  }\r
507 \r
508 Update subscription\r
509 -------------------\r
510 \r
511 **Description**: Update a subscription to a feed.\r
512 \r
513 Request URL\r
514 ===========\r
515 \r
516 http[s]://{host}:{port}/subs/{subId}\r
517 \r
518 * {subId}: Id of the subscription to be updated\r
519 \r
520 Sample Request\r
521 ==============\r
522 \r
523 ``curl -k -X PUT -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @updateSubscriber.json https://{host}:{port}/subs/{subId}``\r
524 \r
525 Request Parameters:\r
526 ===================\r
527 \r
528 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
529 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
530 +========================+=================================+==================+============+==============+=============+======================================+\r
531 | subId                  | ID for the subscription you are |     Path         |   String   |              |     Y       |                                      |\r
532 |                        | updating                        |                  |            |              |             |                                      |\r
533 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
534 | delivery               | Address and credentials for     |     Body         |   Object   |              |     Y       |                                      |\r
535 |                        | delivery                        |                  |            |              |             |                                      |\r
536 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
537 | follow_redirect        | Set to true if feed redirection |     Body         |   Boolean  |              |     Y       | * true                               |\r
538 |                        | is expected                     |                  |            |              |             | * false                              |\r
539 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
540 | metadata_only          | Set to true if subscription is  |     Body         |   Boolean  |              |     Y       | * true                               |\r
541 |                        | to receive per-file metadata    |                  |            |              |             | * false                              |\r
542 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
543 | suspend                | Set to true if the subscription |     Body         |   Boolean  |              |     N       | * true                               |\r
544 |                        | is in the suspended state       |                  |            |              |             | * false                              |\r
545 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
546 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                                      |\r
547 |                        |                                 |                  |            |              |             |                                      |\r
548 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
549 | content-type           | To specify type of message      |     Header       |   String   |              |     Y       | application/vnd.dmaap-dr.subscription|\r
550 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                                      |\r
551 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
552 | X-DMAAP-DR-ON-BEHALF-OF| User id of subscriber           |     Header       |   String   |     8        |     Y       |  username                            |\r
553 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
554 \r
555 Response/Error Codes\r
556 ====================\r
557 \r
558 +------------------------+-------------------------------------------+\r
559 | Response statusCode    | Response Description                      |\r
560 +========================+===========================================+\r
561 | 200                    | Successful query                          |\r
562 +------------------------+-------------------------------------------+\r
563 | 400                    | Bad request - The request is defective in |\r
564 |                        | some way. Possible causes:                |\r
565 |                        |                                           |\r
566 |                        | * JSON object in request body does not    |\r
567 |                        |   conform to the spec.                    |\r
568 |                        | * Invalid parameter value in query string |\r
569 +------------------------+-------------------------------------------+\r
570 | 401                    | Indicates that the request was missing the|\r
571 |                        | Authorization header or, if the header    |\r
572 |                        | was presented, the credentials were not   |\r
573 |                        | acceptable                                |\r
574 +------------------------+-------------------------------------------+\r
575 | 403                    | The request failed authorization.         |\r
576 |                        | Possible causes:                          |\r
577 |                        |                                           |\r
578 |                        | * Request originated from an unauthorized |\r
579 |                        |   IP address                              |\r
580 |                        | * Client certificate subject is not on    |\r
581 |                        |   the API’s authorized list.              |\r
582 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
583 |                        |   authorized to perform                   |\r
584 +------------------------+-------------------------------------------+\r
585 | 404                    | Not Found - The Request-URI does not point|\r
586 |                        | to a resource that is known to the API.   |\r
587 +------------------------+-------------------------------------------+\r
588 | 405                    | Method Not Allowed - The HTTP method in   |\r
589 |                        | the request is not supported for the      |\r
590 |                        | resource addressed by the Request-URI.    |\r
591 +------------------------+-------------------------------------------+\r
592 | 415                    | Unsupported Media Type - The media type in|\r
593 |                        | the request’s Content-Type header is not  |\r
594 |                        | appropriate for the request.              |\r
595 +------------------------+-------------------------------------------+\r
596 | 500                    | Internal Server Error - The DR API server |\r
597 |                        | encountered an internal error and could   |\r
598 |                        | not complete the request.                 |\r
599 +------------------------+-------------------------------------------+\r
600 | 503                    | Service Unavailable - The DR API service  |\r
601 |                        | is currently unavailable                  |\r
602 +------------------------+-------------------------------------------+\r
603 | -1                     | Failed Delivery                           |\r
604 +------------------------+-------------------------------------------+\r
605 \r
606 Sample Body\r
607 ===========\r
608 .. code-block:: json\r
609 \r
610  {\r
611     "delivery" :{\r
612         "url" : "http://192.0.0.1:7070/",\r
613         "user" : "NEW_LOGIN",\r
614         "password" : "NEW_PASSWORD",\r
615         "use100" : true\r
616     },\r
617     "metadataOnly" : false,\r
618     "groupid" : 2,\r
619     "subscriber" : "subuser"\r
620  }\r
621 \r
622 \r
623 Get a Subscription\r
624 ------------------\r
625 \r
626 **Description**: Retrieves a representation of the specified subscription.\r
627 \r
628 Request URL\r
629 ===========\r
630 \r
631 http[s]://{host}:{port}/subs/{subId}\r
632 \r
633 * {subId}: Id of the subscription you want to see a representation of\r
634 \r
635 Sample Request\r
636 ==============\r
637 \r
638 ``curl -k -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
639 \r
640 Response/Error Codes\r
641 ====================\r
642 \r
643 +------------------------+-------------------------------------------+\r
644 | Response statusCode    | Response Description                      |\r
645 +========================+===========================================+\r
646 | 200                    | Successful query                          |\r
647 +------------------------+-------------------------------------------+\r
648 | 401                    | Indicates that the request was missing the|\r
649 |                        | Authorization header or, if the header    |\r
650 |                        | was presented, the credentials were not   |\r
651 |                        | acceptable                                |\r
652 +------------------------+-------------------------------------------+\r
653 | 403                    | The request failed authorization.         |\r
654 |                        | Possible causes:                          |\r
655 |                        |                                           |\r
656 |                        | * Request originated from an unauthorized |\r
657 |                        |   IP address                              |\r
658 |                        | * Client certificate subject is not on    |\r
659 |                        |   the API’s authorized list.              |\r
660 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
661 |                        |   authorized to perform                   |\r
662 +------------------------+-------------------------------------------+\r
663 | 404                    | Not Found - The Request-URI does not point|\r
664 |                        | to a resource that is known to the API.   |\r
665 +------------------------+-------------------------------------------+\r
666 | 405                    | Method Not Allowed - The HTTP method in   |\r
667 |                        | the request is not supported for the      |\r
668 |                        | resource addressed by the Request-URI.    |\r
669 +------------------------+-------------------------------------------+\r
670 | 415                    | Unsupported Media Type - The media type in|\r
671 |                        | the request’s Content-Type header is not  |\r
672 |                        | appropriate for the request.              |\r
673 +------------------------+-------------------------------------------+\r
674 | 500                    | Internal Server Error - The DR API server |\r
675 |                        | encountered an internal error and could   |\r
676 |                        | not complete the request.                 |\r
677 +------------------------+-------------------------------------------+\r
678 | 503                    | Service Unavailable - The DR API service  |\r
679 |                        | is currently unavailable                  |\r
680 +------------------------+-------------------------------------------+\r
681 | -1                     | Failed Delivery                           |\r
682 +------------------------+-------------------------------------------+\r
683 \r
684 Delete a subscription\r
685 ---------------------\r
686 \r
687 **Description**: Deletes a specified subscription\r
688 \r
689 Request URL\r
690 ===========\r
691 \r
692 http[s]://{host}:{port}/subs/{subId}\r
693 \r
694 * {subId}: Id of the subscription you want to delete\r
695 \r
696 Sample Request\r
697 ==============\r
698 \r
699 ``curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
700 \r
701 Response/Error Codes\r
702 ====================\r
703 \r
704 +------------------------+-------------------------------------------+\r
705 | Response statusCode    | Response Description                      |\r
706 +========================+===========================================+\r
707 | 204                    | Successful query                          |\r
708 +------------------------+-------------------------------------------+\r
709 | 401                    | Indicates that the request was missing the|\r
710 |                        | Authorization header or, if the header    |\r
711 |                        | was presented, the credentials were not   |\r
712 |                        | acceptable                                |\r
713 +------------------------+-------------------------------------------+\r
714 | 403                    | The request failed authorization.         |\r
715 |                        | Possible causes:                          |\r
716 |                        |                                           |\r
717 |                        | * Request originated from an unauthorized |\r
718 |                        |   IP address                              |\r
719 |                        | * Client certificate subject is not on    |\r
720 |                        |   the API’s authorized list.              |\r
721 |                        | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
722 |                        |   authorized to perform                   |\r
723 +------------------------+-------------------------------------------+\r
724 | 404                    | Not Found - The Request-URI does not point|\r
725 |                        | to a resource that is known to the API.   |\r
726 +------------------------+-------------------------------------------+\r
727 | 405                    | Method Not Allowed - The HTTP method in   |\r
728 |                        | the request is not supported for the      |\r
729 |                        | resource addressed by the Request-URI.    |\r
730 +------------------------+-------------------------------------------+\r
731 | 415                    | Unsupported Media Type - The media type in|\r
732 |                        | the request’s Content-Type header is not  |\r
733 |                        | appropriate for the request.              |\r
734 +------------------------+-------------------------------------------+\r
735 | 500                    | Internal Server Error - The DR API server |\r
736 |                        | encountered an internal error and could   |\r
737 |                        | not complete the request.                 |\r
738 +------------------------+-------------------------------------------+\r
739 | 503                    | Service Unavailable - The DR API service  |\r
740 |                        | is currently unavailable                  |\r
741 +------------------------+-------------------------------------------+\r
742 | -1                     | Failed Delivery                           |\r
743 +------------------------+-------------------------------------------+\r
744 \r
745 Publish to Feed\r
746 ---------------\r
747 \r
748 **Description**: Publish data to a given feed\r
749 \r
750 Request URL\r
751 ===========\r
752 \r
753 http[s]://{host}:{port}/publish/{feedId}/{fileName}\r
754 \r
755 * {feedId} The id of the feed you are publishing to.\r
756 * {fileId} The name of the file you are publishing to the feed.\r
757 \r
758 Sample Request\r
759 ==============\r
760 \r
761 ``curl -k -X PUT --user {user}:{password} -H "Content-Type:application/octet-stream"  -H "X-DMAAP-DR-META:{\"filetype\":\"txt\"}" --data-binary @sampleFile.txt --post301 --location-trusted https://{host}:{port}/publish/{feedId}/sampleFile``\r
762 \r
763 Request parameters\r
764 ==================\r
765 \r
766 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
767 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                                                    |\r
768 +========================+=================================+==================+============+==============+=============+==========================================================================+\r
769 | feedId                 | ID of the feed you are          |     Path         |   String   |              |     Y       |                                                                          |\r
770 |                        | publishing to                   |                  |            |              |             |                                                                          |\r
771 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
772 | fileId                 | Name of the file when it  is    |     Path         |   String   |              |     Y       |                                                                          |\r
773 |                        | published to subscribers        |                  |            |              |             |                                                                          |\r
774 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
775 | content-type           | To specify type of message      |     Header       |   String   |              |     Y       | application/octet-stream                                                 |\r
776 |                        | format                          |                  |            |              |             |                                                                          |\r
777 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
778 | X-DMAAP-DR-META        | Metadata for the file. Accepts  |     Header       |   String   |     4096     |     N       | '{"compressionType":"gzip","id": 1234, "transferred":true, "size":null}' |\r
779 |                        | only non nested json objects    |                  |            |              |             |                                                                          |\r
780 |                        | of the following type :         |                  |            |              |             |                                                                          |\r
781 |                        | -Numbers                        |                  |            |              |             |                                                                          |\r
782 |                        | -Strings                        |                  |            |              |             |                                                                          |\r
783 |                        | -Lowercase boolean              |                  |            |              |             |                                                                          |\r
784 |                        | -null                           |                  |            |              |             |                                                                          |\r
785 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
786 \r
787 Response/Error Codes\r
788 ====================\r
789 \r
790 +------------------------+---------------------------------+\r
791 | Response statusCode    | Response Description            |\r
792 +========================+=================================+\r
793 | 204                    | Successful PUT or DELETE        |\r
794 +------------------------+---------------------------------+\r
795 | 400                    | Failure - Malformed request     |\r
796 +------------------------+---------------------------------+\r
797 | 401                    | Failure - Request was missing   |\r
798 |                        | authorization header, or        |\r
799 |                        | credentials were not accepted   |\r
800 +------------------------+---------------------------------+\r
801 | 403                    | Failure - User could not be     |\r
802 |                        | authenticated, or was not       |\r
803 |                        | authorized to make the request  |\r
804 +------------------------+---------------------------------+\r
805 | 404                    | Failure - Path in the request   |\r
806 |                        | URL did not point to a valid    |\r
807 |                        | feed publishing URL             |\r
808 +------------------------+---------------------------------+\r
809 | 500                    | Failure - DR experienced an     |\r
810 |                        | internal problem                |\r
811 +------------------------+---------------------------------+\r
812 | 503                    | Failure - DR is not currently   |\r
813 |                        | available                       |\r
814 +------------------------+---------------------------------+\r
815 \r
816 \r
817 Delete a Published file\r
818 -----------------------\r
819 \r
820 **Description**: Deletes a specified published file\r
821 \r
822 Request URL\r
823 ===========\r
824 \r
825 http[s]://{host}:{port}/publish/{feedId}/{fileId}\r
826 \r
827 * {feedId}: Id of the feed you want to delete a published file from\r
828 * {fileId}: Id of the published file you want to delete\r
829 \r
830 Sample Request\r
831 ==============\r
832 \r
833 ``curl -k -X DELETE --user {user}:{password} --location-trusted https://{host}:{port}/publish/{feedId}/{fileId}``\r
834 \r
835 Response/Error Codes\r
836 ====================\r
837 \r
838 +------------------------+---------------------------------+\r
839 | Response statusCode    | Response Description            |\r
840 +========================+=================================+\r
841 | 204                    | Successful PUT or DELETE        |\r
842 +------------------------+---------------------------------+\r
843 | 400                    | Failure - Malformed request     |\r
844 +------------------------+---------------------------------+\r
845 | 401                    | Failure - Request was missing   |\r
846 |                        | authorization header, or        |\r
847 |                        | credentials were not accepted   |\r
848 +------------------------+---------------------------------+\r
849 | 403                    | Failure - User could not be     |\r
850 |                        | authenticated, or was not       |\r
851 |                        | authorized to make the request  |\r
852 +------------------------+---------------------------------+\r
853 | 404                    | Failure - Path in the request   |\r
854 |                        | URL did not point to a valid    |\r
855 |                        | feed publishing URL             |\r
856 +------------------------+---------------------------------+\r
857 | 500                    | Failure - DR experienced an     |\r
858 |                        | internal problem                |\r
859 +------------------------+---------------------------------+\r
860 | 503                    | Failure - DR is not currently   |\r
861 |                        | available                       |\r
862 +------------------------+---------------------------------+\r
863 \r
864 Feed logging\r
865 ------------\r
866 \r
867 **Description**: View logging information for specified feeds, which can be narrowed down with further parameters\r
868 \r
869 Request URL\r
870 ===========\r
871 \r
872 http[s]://{host}:{port}/feedlog/{feedId}?{queryParameter}\r
873 \r
874 * {feedId} : The id of the feed you want to get logs for\r
875 * {queryParameter}: A parameter passed through to narrow the returned logs. Multiple parameters can be passed.\r
876 \r
877 \r
878 Sample Request\r
879 ==============\r
880 \r
881 ``curl -k https://{host}:{port}/feedlog/{feedId}?statusCode=204``\r
882 \r
883 Request parameters\r
884 ==================\r
885 \r
886 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
887 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
888 +========================+=================================+==================+============+==============+=============+======================================+\r
889 | feedId                 | Id of the feed you want         |     Path         |   String   |              |     N       | 1                                    |\r
890 |                        | logs for                        |                  |            |              |             |                                      |\r
891 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
892 | type                   | Select records of the           |     Path         |   String   |              |     N       | * pub: Publish attempt               |\r
893 |                        | specified type                  |                  |            |              |             | * del: Delivery attempt              |\r
894 |                        |                                 |                  |            |              |             | * exp: Delivery expiry               |\r
895 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
896 | publishId              | Select records with specified   |     Path         |   String   |              |     N       |                                      |\r
897 |                        | publish id, carried in the      |                  |            |              |             |                                      |\r
898 |                        | X-DMAAP-DR-PUBLISH-ID header    |                  |            |              |             |                                      |\r
899 |                        | from original publish request   |                  |            |              |             |                                      |\r
900 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
901 | start                  | Select records created at or    |     Path         |   String   |              |     N       | A date-time expressed in the format  |\r
902 |                        | after specified date            |                  |            |              |             | specified by RFC 3339                |\r
903 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
904 | end                    | Select records created at or    |     Path         |   String   |              |     N       | A date-time expressed in the format  |\r
905 |                        | before specified date           |                  |            |              |             | specified by RFC 3339                |\r
906 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
907 | statusCode             | Select records with the         |     Path         |   String   |              |     N       | An HTTP Integer status code or one   |\r
908 |                        | specified statusCode field      |                  |            |              |             | of the following special values:     |\r
909 |                        |                                 |                  |            |              |             |                                      |\r
910 |                        |                                 |                  |            |              |             | * Success: Any code between 200-299  |\r
911 |                        |                                 |                  |            |              |             | * Redirect: Any code between 300-399 |\r
912 |                        |                                 |                  |            |              |             | * Failure: Any code > 399            |\r
913 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
914 | expiryReason           | Select records with the         |     Path         |   String   |              |     N       |                                      |\r
915 |                        | specified expiry reason         |                  |            |              |             |                                      |\r
916 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
917 \r
918 Response Parameters\r
919 ===================\r
920 \r
921 +------------------------+----------------------------------------------+\r
922 | Name                   | Description                                  |\r
923 +========================+==============================================+\r
924 | type                   | Record type:                                 |\r
925 |                        |                                              |\r
926 |                        | * pub: publication attempt                   |\r
927 |                        | * del: delivery attempt                      |\r
928 |                        | * exp: delivery expiry                       |\r
929 +------------------------+----------------------------------------------+\r
930 | date                   | The UTC date and time at which the record    |\r
931 |                        | was generated, with millisecond resolution   |\r
932 |                        | in the format specified by RFC 3339          |\r
933 +------------------------+----------------------------------------------+\r
934 | publishId              | The unique identifier assigned by the DR     |\r
935 |                        | at the time of the initial publication       |\r
936 |                        | request (carried in the X-DMAAP-DR-PUBLISH-ID|\r
937 |                        | header in the response to the original       |\r
938 |                        | publish request)                             |\r
939 +------------------------+----------------------------------------------+\r
940 | requestURI             | The Request-URI associated with the          |\r
941 |                        | request                                      |\r
942 +------------------------+----------------------------------------------+\r
943 | method                 | The HTTP method (PUT or DELETE) for the      |\r
944 |                        | request                                      |\r
945 +------------------------+----------------------------------------------+\r
946 | contentType            | The media type of the payload of the         |\r
947 |                        | request                                      |\r
948 +------------------------+----------------------------------------------+\r
949 | contentLength          | The size (in bytes) of the payload of        |\r
950 |                        | the request                                  |\r
951 +------------------------+----------------------------------------------+\r
952 | sourceIp               | The IP address from which the request        |\r
953 |                        | originated                                   |\r
954 +------------------------+----------------------------------------------+\r
955 | endpointId             | The identity used to submit a publish        |\r
956 |                        | request to the DR                            |\r
957 +------------------------+----------------------------------------------+\r
958 | deliveryId             | The identity used to submit a delivery       |\r
959 |                        | request to a subscriber endpoint             |\r
960 +------------------------+----------------------------------------------+\r
961 | statusCode             | The HTTP status code in the response to      |\r
962 |                        | the request. A value of -1 indicates that    |\r
963 |                        | the DR was not able to obtain an HTTP        |\r
964 |                        | status code                                  |\r
965 +------------------------+----------------------------------------------+\r
966 | expiryReason           | The reason that delivery attempts were       |\r
967 |                        | discontinued:                                |\r
968 |                        |                                              |\r
969 |                        | * notRetryable: The last delivery attempt    |\r
970 |                        |   encountered an error condition for which   |\r
971 |                        |   the DR does not make retries.              |\r
972 |                        | * retriesExhausted: The DR reached its       |\r
973 |                        |   limit for making further retry attempts    |\r
974 +------------------------+----------------------------------------------+\r
975 | attempts               | Total number of attempts made before         |\r
976 |                        | delivery attempts were discontinued          |\r
977 +------------------------+----------------------------------------------+\r
978 \r
979 Response/Error Codes\r
980 ====================\r
981 \r
982 +------------------------+-------------------------------------------+\r
983 | Response statusCode    | Response Description                      |\r
984 +========================+===========================================+\r
985 | 200                    | Successful query                          |\r
986 +------------------------+-------------------------------------------+\r
987 | 400                    | Bad request - The request is defective in |\r
988 |                        | some way. Possible causes:                |\r
989 |                        |                                           |\r
990 |                        | * Unrecognized parameter name in query    |\r
991 |                        |   string                                  |\r
992 |                        | * Invalid parameter value in query string |\r
993 +------------------------+-------------------------------------------+\r
994 | 404                    | Not Found - The request was not directed  |\r
995 |                        | to a feed log URL or subscription log URL |\r
996 |                        | known to the system                       |\r
997 +------------------------+-------------------------------------------+\r
998 | 405                    | Method not allowed - The HTTP method in   |\r
999 |                        | the request was something other than GET  |\r
1000 +------------------------+-------------------------------------------+\r
1001 | 406                    | Not Acceptable - The request has an Accept|\r
1002 |                        | header indicating that the requester will |\r
1003 |                        | not accept a response with                |\r
1004 |                        | application/vnd.dmaap-dr.log-list content.|\r
1005 +------------------------+-------------------------------------------+\r
1006 | 500                    | Internal Server Error - The DR API server |\r
1007 |                        | encountered an internal error and could   |\r
1008 |                        | not complete the request                  |\r
1009 +------------------------+-------------------------------------------+\r
1010 | 503                    | Service Unavailable - The DR API service  |\r
1011 |                        | is currently unavailable                  |\r
1012 +------------------------+-------------------------------------------+\r
1013 \r
1014 \r
1015 Subscription logging\r
1016 ------------------\r
1017 \r
1018 **Description**: View logging information for specified subscriptions, which can be narrowed down with further parameters\r
1019 \r
1020 Request URL\r
1021 ===========\r
1022 \r
1023 http[s]://{host}:{port}/sublog/{subId}?{queryParameter}\r
1024 \r
1025 * {subId}: The id of the feed you want to get logs from\r
1026 * {queryParameter}: A parameter passed through to narrow the returned logs. Multiple parameters can be passed.\r
1027 \r
1028 \r
1029 Sample Request\r
1030 ==============\r
1031 \r
1032 ``curl -k https://{host}:{port}/sublog/{subId}?statusCode=204``\r
1033 \r
1034 Request parameters\r
1035 ==================\r
1036 \r
1037 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1038 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Valid/Example Values                |\r
1039 +========================+=================================+==================+============+==============+=============+======================================+\r
1040 | subId                  | Id of the subscription you want |     Path         |   String   |              |     N       | 1                                    |\r
1041 |                        | logs for                        |                  |            |              |             |                                      |\r
1042 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1043 | type                   | Select records of the           |     Path         |   String   |              |     N       | * pub: Publish attempt               |\r
1044 |                        | specified type                  |                  |            |              |             | * del: Delivery attempt              |\r
1045 |                        |                                 |                  |            |              |             | * exp: Delivery expiry               |\r
1046 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1047 | publishId              | Select records with specified   |     Path         |   String   |              |     N       |                                      |\r
1048 |                        | publish id, carried in the      |                  |            |              |             |                                      |\r
1049 |                        | X-DMAAP-DR-PUBLISH-ID header    |                  |            |              |             |                                      |\r
1050 |                        | from original publish request   |                  |            |              |             |                                      |\r
1051 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1052 | start                  | Select records created at or    |     Path         |   String   |              |     N       | A date-time expressed in the format  |\r
1053 |                        | after specified date            |                  |            |              |             | specified by RFC 3339                |\r
1054 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1055 | end                    | Select records created at or    |     Path         |   String   |              |     N       | A date-time expressed in the format  |\r
1056 |                        | before specified date           |                  |            |              |             | specified by RFC 3339                |\r
1057 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1058 | statusCode             | Select records with the         |     Path         |   String   |              |     N       | An Http Integer status code or one   |\r
1059 |                        | specified statusCode field      |                  |            |              |             | of the following special values:     |\r
1060 |                        |                                 |                  |            |              |             |                                      |\r
1061 |                        |                                 |                  |            |              |             | * Success: Any code between 200-299  |\r
1062 |                        |                                 |                  |            |              |             | * Redirect: Any code between 300-399 |\r
1063 |                        |                                 |                  |            |              |             | * Failure: Any code > 399            |\r
1064 |                        |                                 |                  |            |              |             |                                      |\r
1065 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1066 | expiryReason           | Select records with the         |     Path         |   String   |              |     N       |                                      |\r
1067 |                        | specified expiry reason         |                  |            |              |             |                                      |\r
1068 +------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
1069 \r
1070 Response Parameters\r
1071 ===================\r
1072 \r
1073 +------------------------+---------------------------------------------+\r
1074 | Name                   | Description                                 |\r
1075 +========================+=============================================+\r
1076 | type                   | Record type:                                |\r
1077 |                        |                                             |\r
1078 |                        | * pub: publication attempt                  |\r
1079 |                        | * del: delivery attempt                     |\r
1080 |                        | * exp: delivery expiry                      |\r
1081 +------------------------+---------------------------------------------+\r
1082 | date                   | The UTC date and time at which the record   |\r
1083 |                        | was generated, with millisecond resolution  |\r
1084 |                        | in the format specified by RFC 3339         |\r
1085 +------------------------+---------------------------------------------+\r
1086 | publishId              | The unique identifier assigned by the DR    |\r
1087 |                        | at the time of the initial publication      |\r
1088 |                        | request(carried in the X-DMAAP-DR-PUBLISH-ID|\r
1089 |                        | header in the response to the original      |\r
1090 |                        | publish request) to a feed log URL or       |\r
1091 |                        | subscription log URL known to the system    |\r
1092 +------------------------+---------------------------------------------+\r
1093 | requestURI             | The Request-URI associated with the         |\r
1094 |                        | request                                     |\r
1095 +------------------------+---------------------------------------------+\r
1096 | method                 | The HTTP method (PUT or DELETE) for the     |\r
1097 |                        | request                                     |\r
1098 +------------------------+---------------------------------------------+\r
1099 | contentType            | The media type of the payload of the        |\r
1100 |                        | request                                     |\r
1101 +------------------------+---------------------------------------------+\r
1102 | contentLength          | The size (in bytes) of the payload of       |\r
1103 |                        | the request                                 |\r
1104 +------------------------+---------------------------------------------+\r
1105 | sourceIp               | The IP address from which the request       |\r
1106 |                        | originated                                  |\r
1107 +------------------------+---------------------------------------------+\r
1108 | endpointId             | The identity used to submit a publish       |\r
1109 |                        | request to the DR                           |\r
1110 +------------------------+---------------------------------------------+\r
1111 | deliveryId             | The identity used to submit a delivery      |\r
1112 |                        | request to a subscriber endpoint            |\r
1113 +------------------------+---------------------------------------------+\r
1114 | statusCode             | The HTTP status code in the response to     |\r
1115 |                        | the request. A value of -1 indicates that   |\r
1116 |                        | the DR was not able to obtain an HTTP       |\r
1117 |                        | status code                                 |\r
1118 +------------------------+---------------------------------------------+\r
1119 | expiryReason           | The reason that delivery attempts were      |\r
1120 |                        | discontinued:                               |\r
1121 |                        |                                             |\r
1122 |                        | * notRetryable: The last delivery attempt   |\r
1123 |                        |   encountered an error condition for which  |\r
1124 |                        |   the DR does not make retries.             |\r
1125 |                        | * retriesExhausted: The DR reached its      |\r
1126 |                        |   limit for making further retry attempts   |\r
1127 +------------------------+---------------------------------------------+\r
1128 | attempts               | Total number of attempts made before        |\r
1129 |                        | delivery attempts were discontinued         |\r
1130 +------------------------+---------------------------------------------+\r
1131 \r
1132 Response/Error Codes\r
1133 ====================\r
1134 \r
1135 +------------------------+-------------------------------------------+\r
1136 | Response statusCode    | Response Description                      |\r
1137 +========================+===========================================+\r
1138 | 200                    | Successful query                          |\r
1139 +------------------------+-------------------------------------------+\r
1140 | 400                    | Bad request - The request is defective in |\r
1141 |                        | some way. Possible causes:                |\r
1142 |                        |                                           |\r
1143 |                        | * Unrecognized parameter name in query    |\r
1144 |                        |   string                                  |\r
1145 |                        | * Invalid parameter value in query string |\r
1146 +------------------------+-------------------------------------------+\r
1147 | 404                    | Not Found - The request was not directed  |\r
1148 |                        | to a feed log URL or subscription log URL |\r
1149 |                        | known to the system                       |\r
1150 +------------------------+-------------------------------------------+\r
1151 | 405                    | Method not allowed - The HTTP method in   |\r
1152 |                        | the request was something other than GET  |\r
1153 +------------------------+-------------------------------------------+\r
1154 | 406                    | Not Acceptable - The request has an Accept|\r
1155 |                        | header indicating that the requester will |\r
1156 |                        | not accept a response with                |\r
1157 |                        | application/vnd.dmaap-dr.log-list content.|\r
1158 +------------------------+-------------------------------------------+\r
1159 | 500                    | Internal Server Error - The DR API server |\r
1160 |                        | encountered an internal error and could   |\r
1161 |                        | could not complete the request            |\r
1162 +------------------------+-------------------------------------------+\r
1163 | 503                    | Service Unavailable - The DR API service  |\r
1164 |                        | is currently unavailable                  |\r
1165 +------------------------+-------------------------------------------+\r