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