44d7b4c05b34b4d8701e6bbdb8112df7587bb54c
[dmaap/datarouter.git] / docs / data-router / data-router.rst
1 ==========================\r
2 Data Router (DR) API Guide\r
3 ==========================\r
4 Introduction\r
5 ------------\r
6 \r
7 The DataRouter(DR) provisioning API is an HTTPS-based, REST-like API for creating and managing DR feeds and subscriptions. The Data Routing System project is intended to provide a common framework by which data producers can make data available to data consumers and a way for potential consumers to find feeds with the data they require.\r
8 \r
9 \r
10 HTTP Service APIs\r
11 -----------------\r
12 \r
13 DMaaP Data Router utilizes an HTTP REST API to service all transactions. HTTP and REST standards are followed so\r
14 clients as varied as CURL, Java applications and even Web Browsers will\r
15 work to interact with the Data Router.\r
16 \r
17 General HTTP Requirements\r
18 =========================\r
19 \r
20 A DMaaP Data Router transactions consists of 4 distinct segments,\r
21 HTTP URL, HTTP Header, HTTP Body (POST/PUT) and HTTP Response. The general\r
22 considerations for each segment are as follows and are required for each\r
23 of the specific transactions described in this section.\r
24 \r
25 HTTP URL\r
26 ========\r
27 \r
28 http[s]://{serverBaseURL}/{resourcePath}\r
29 \r
30 * The serverBaseURL points to DMaaP Data Router host/port that will service the request.\r
31 * The resourcePath specifies the specific service that the client is attempting to reach.\r
32 \r
33 \r
34 HTTP Header\r
35 ===========\r
36 \r
37 Specifies HTTP Headers, such as Content-Type, that define the parameters of the HTTP Transaction\r
38 \r
39 HTTP Body\r
40 =========\r
41 \r
42 The HTTP Body contains the feed content when creating a feed.\r
43 \r
44 Create a Feed\r
45 -------------\r
46 \r
47 **Description**: Creates a unique set of URL's to service the publisher/subscriber model.\r
48 \r
49 Sample Request\r
50 ==============\r
51 \r
52 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
53 \r
54 Request Parameters:\r
55 ===================\r
56 \r
57 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
58 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Format             |  Valid/Example Values                |\r
59 +========================+=================================+==================+============+==============+=============+=====================+======================================+\r
60 | name                   | Feed name                       |     Body         |   String   |    <=20      |     Y       |                     |                                      |\r
61 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
62 | version                | Feed version                    |     Body         |   String   |    <=20      |     Y       |                     |                                      |\r
63 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
64 | description            | Feed description                |     Body         |   String   |              |     Y       |                     |                                      |\r
65 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
66 | business description   | Business description            |     Body         |   String   |              |     Y       |                     |                                      |\r
67 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
68 | Authorization          | Information for authorizing     |     Body         |   Object   |              |     Y       |                     |                                      |\r
69 |                        | publishing requests             |                  |            |              |             |                     |                                      |\r
70 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
71 | suspend                | Set to true if the feed is in   |     Body         |   Boolean  |              |     N       |                     | true                                 |\r
72 |                        | the suspended state             |                  |            |              |             |                     | false                                |\r
73 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
74 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                     |                                      |\r
75 |                        |                                 |                  |            |              |             |                     |                                      |\r
76 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
77 | content-type           | To specify type of message      |     Header       |   String   |     20       |     N       |                     | application/vnd.att-dr.subscription  |\r
78 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                     |                                      |\r
79 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
80 | X-ATT-DR-ON-BEHALF-OF  | User id of subscriber           |     Header       |   String   |     1        |     N       |                     |  username                            |\r
81 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
82 \r
83 Response/Error Codes\r
84 ====================\r
85 \r
86 +------------------------+-------------------------------------------+\r
87 | Response statusCode    | Response Description                      |\r
88 +========================+===========================================+\r
89 | 200                    | Successful query                          |\r
90 +------------------------+-------------------------------------------+\r
91 | 400                    | Bad request - The request is defective in |\r
92 |                        | some way. Possible causes:                |\r
93 |                        |                                           |\r
94 |                        | * JSON object in request body does not    |\r
95 |                        |   conform to the spec.                    |\r
96 |                        | * Invalid parameter value in query string |\r
97 +------------------------+-------------------------------------------+\r
98 | 401                    | Indicates that the request was missing the|\r
99 |                        | Authorization header or, if the header    |\r
100 |                        | was presented, the credentials were not   |\r
101 |                        | acceptable                                |\r
102 +------------------------+-------------------------------------------+\r
103 | 403                    | The request failed authorization.         |\r
104 |                        | Possible causes:                          |\r
105 |                        |                                           |\r
106 |                        | * Request originated from an unauthorized |\r
107 |                        |   IP address                              |\r
108 |                        | * Client certificate subject is not on    |\r
109 |                        |   the API’s authorized list.              |\r
110 |                        | * X-ATT-DR-ON-BEHALF-OF identity is not   |\r
111 |                        |   authorized to perform                   |\r
112 +------------------------+-------------------------------------------+\r
113 | 404                    | Not Found - The Request-URI does not point|\r
114 |                        | to a resource that is known to the API.   |\r
115 +------------------------+-------------------------------------------+\r
116 | 405                    | Method Not Allowed - The HTTP method in   |\r
117 |                        | the request is not supported for the      |\r
118 |                        | resource addressed by the Request-URI.    |\r
119 +------------------------+-------------------------------------------+\r
120 | 415                    | Unsupported Media Type - The media type in|\r
121 |                        | the request’s Content-Type header is not  |\r
122 |                        | appropriate for the request.              |\r
123 +------------------------+-------------------------------------------+\r
124 | 500                    | Internal Server Error - The DR API server |\r
125 |                        | encountered an internal error and could   |\r
126 |                        | not complete the request.                 |\r
127 +------------------------+-------------------------------------------+\r
128 | 503                    | Service Unavailable - The DR API service  |\r
129 |                        | is currently unavailable                  |\r
130 +------------------------+-------------------------------------------+\r
131 | -1                     | Failed Delivery                           |\r
132 +------------------------+-------------------------------------------+\r
133 \r
134 Sample Body\r
135 ===========\r
136 .. code-block:: json\r
137 \r
138  {\r
139      "name": "Jettydemo",\r
140      "version": "m1.0",\r
141      "description": "Jettydemo",\r
142      "business_description": "Jettydemo",\r
143      "suspend": false,\r
144      "deleted": false,\r
145      "changeowner": true,\r
146      "authorization": {\r
147           "classification": "unclassified",\r
148           "endpoint_addrs": [\r
149                "172.18.0.3",\r
150             ],\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 \r
162 Get a Feed\r
163 ----------\r
164 \r
165 **Description**: Retrieves a representation of the specified feed.\r
166 \r
167 Request URL\r
168 ===========\r
169 \r
170 http[s]://{host}:{port}/feed/{feedId}\r
171 \r
172 * {feedId}: Id of the feed you wish to see a representation of\r
173 \r
174 Sample Request\r
175 ==============\r
176 \r
177 curl -v -X GET -H "X-ATT-DR-ON-BEHALF-OF: {user}" --location-trusted -k https:/{host}:{port}/feed/{feedId}\r
178 \r
179 Response/Error Codes\r
180 ====================\r
181 \r
182 +------------------------+-------------------------------------------+\r
183 | Response statusCode    | Response Description                      |\r
184 +========================+===========================================+\r
185 | 200                    | Successful query                          |\r
186 +------------------------+-------------------------------------------+\r
187 | 401                    | Indicates that the request was missing the|\r
188 |                        | Authorization header or, if the header    |\r
189 |                        | was presented, the credentials were not   |\r
190 |                        | acceptable                                |\r
191 +------------------------+-------------------------------------------+\r
192 | 403                    | The request failed authorization.         |\r
193 |                        | Possible causes:                          |\r
194 |                        |                                           |\r
195 |                        | * Request originated from an unauthorized |\r
196 |                        |   IP address                              |\r
197 |                        | * Client certificate subject is not on    |\r
198 |                        |   the API’s authorized list.              |\r
199 |                        | * X-ATT-DR-ON-BEHALF-OF identity is not   |\r
200 |                        |   authorized to perform                   |\r
201 +------------------------+-------------------------------------------+\r
202 | 404                    | Not Found - The Request-URI does not point|\r
203 |                        | to a resource that is known to the API.   |\r
204 +------------------------+-------------------------------------------+\r
205 | 405                    | Method Not Allowed - The HTTP method in   |\r
206 |                        | the request is not supported for the      |\r
207 |                        | resource addressed by the Request-URI.    |\r
208 +------------------------+-------------------------------------------+\r
209 | 415                    | Unsupported Media Type - The media type in|\r
210 |                        | the request’s Content-Type header is not  |\r
211 |                        | appropriate for the request.              |\r
212 +------------------------+-------------------------------------------+\r
213 | 500                    | Internal Server Error - The DR API server |\r
214 |                        | encountered an internal error and could   |\r
215 |                        | not complete the request.                 |\r
216 +------------------------+-------------------------------------------+\r
217 | 503                    | Service Unavailable - The DR API service  |\r
218 |                        | is currently unavailable                  |\r
219 +------------------------+-------------------------------------------+\r
220 | -1                     | Failed Delivery                           |\r
221 +------------------------+-------------------------------------------+\r
222 \r
223 \r
224 \r
225 Subscribe to Feed\r
226 -----------------\r
227 \r
228 **Description**: Subscribes to a created feed to receive files published to that feed.\r
229 \r
230 Request URL\r
231 ===========\r
232 \r
233 http[s]://{host}:{port}/subscribe/{feedId}\r
234 \r
235 Sample Request\r
236 ==============\r
237 \r
238 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
239 \r
240 Request Parameters:\r
241 ===================\r
242 \r
243 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
244 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Format             |  Valid/Example Values                |\r
245 +========================+=================================+==================+============+==============+=============+=====================+======================================+\r
246 | feedId                 | ID for the feed you are         |     Path         |   String   |              |     Y       |                     |                                      |\r
247 |                        | subscribing to                  |                  |            |              |             |                     |                                      |\r
248 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
249 | delivery               | Address and credentials for     |     Body         |   Object   |              |     Y       |                     |                                      |\r
250 |                        | delivery                        |                  |            |              |             |                     |                                      |\r
251 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
252 | follow_redirect        | Set to true if feed redirection |     Body         |   Boolean  |              |     Y       |                     | true                                 |\r
253 |                        | is expected                     |                  |            |              |             |                     | false                                |\r
254 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
255 | metadata_only          | Set to true if subscription is  |     Body         |   Boolean  |              |     Y       |                     | true                                 |\r
256 |                        | to receive per-file metadata    |                  |            |              |             |                     | false                                |\r
257 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
258 | suspend                | Set to true if the subscription |     Body         |   Boolean  |              |     N       |                     | true                                 |\r
259 |                        | is in the suspended state       |                  |            |              |             |                     | false                                |\r
260 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
261 | group-id               |                                 |     Body         |   Integer  |              |     Y       |                     |                                      |\r
262 |                        |                                 |                  |            |              |             |                     |                                      |\r
263 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
264 | content-type           | To specify type of message      |     Header       |   String   |     20       |     N       |                     | application/vnd.att-dr.subscription  |\r
265 |                        | (feed,subscriber,publisher)     |                  |            |              |             |                     |                                      |\r
266 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
267 | X-ATT-DR-ON-BEHALF-OF  | User id of subscriber           |     Header       |   String   |     1        |     N       |                     |  username                            |\r
268 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
269 \r
270 Response/Error Codes\r
271 ====================\r
272 \r
273 +------------------------+-------------------------------------------+\r
274 | Response statusCode    | Response Description                      |\r
275 +========================+===========================================+\r
276 | 200                    | Successful query                          |\r
277 +------------------------+-------------------------------------------+\r
278 | 400                    | Bad request - The request is defective in |\r
279 |                        | some way. Possible causes:                |\r
280 |                        |                                           |\r
281 |                        | * JSON object in request body does not    |\r
282 |                        |   conform to the spec.                    |\r
283 |                        | * Invalid parameter value in query string |\r
284 +------------------------+-------------------------------------------+\r
285 | 401                    | Indicates that the request was missing the|\r
286 |                        | Authorization header or, if the header    |\r
287 |                        | was presented, the credentials were not   |\r
288 |                        | acceptable                                |\r
289 +------------------------+-------------------------------------------+\r
290 | 403                    | The request failed authorization.         |\r
291 |                        | Possible causes:                          |\r
292 |                        |                                           |\r
293 |                        | * Request originated from an unauthorized |\r
294 |                        |   IP address                              |\r
295 |                        | * Client certificate subject is not on    |\r
296 |                        |   the API’s authorized list.              |\r
297 |                        | * X-ATT-DR-ON-BEHALF-OF identity is not   |\r
298 |                        |   authorized to perform                   |\r
299 +------------------------+-------------------------------------------+\r
300 | 404                    | Not Found - The Request-URI does not point|\r
301 |                        | to a resource that is known to the API.   |\r
302 +------------------------+-------------------------------------------+\r
303 | 405                    | Method Not Allowed - The HTTP method in   |\r
304 |                        | the request is not supported for the      |\r
305 |                        | resource addressed by the Request-URI.    |\r
306 +------------------------+-------------------------------------------+\r
307 | 415                    | Unsupported Media Type - The media type in|\r
308 |                        | the request’s Content-Type header is not  |\r
309 |                        | appropriate for the request.              |\r
310 +------------------------+-------------------------------------------+\r
311 | 500                    | Internal Server Error - The DR API server |\r
312 |                        | encountered an internal error and could   |\r
313 |                        | not complete the request.                 |\r
314 +------------------------+-------------------------------------------+\r
315 | 503                    | Service Unavailable - The DR API service  |\r
316 |                        | is currently unavailable                  |\r
317 +------------------------+-------------------------------------------+\r
318 | -1                     | Failed Delivery                           |\r
319 +------------------------+-------------------------------------------+\r
320 \r
321 Sample Body\r
322 ===========\r
323 .. code-block:: json\r
324 \r
325  {\r
326     "delivery" :{\r
327         "url" : "http://172.18.0.3:7070/",\r
328         "user" : "LOGIN",\r
329         "password" : "PASSWORD",\r
330         "use100" : true\r
331     },\r
332     "metadataOnly" : false,\r
333     "suspend" : false,\r
334     "groupid" : 29,\r
335     "subscriber" : "sg481n"\r
336 \r
337 }\r
338 \r
339 \r
340 Get a Subscription\r
341 ------------------\r
342 \r
343 **Description**: Retrieves a representation of the specified subscription.\r
344 \r
345 Request URL\r
346 ===========\r
347 \r
348 http[s]://{host}:{port}/subscribe/{subId}\r
349 \r
350 * {subId}: Id of the subscription you wish to see a representation of\r
351 \r
352 Sample Request\r
353 ==============\r
354 \r
355 curl -v -X GET -H "X-ATT-DR-ON-BEHALF-OF: {user}" --location-trusted -k https:/{host}:{port}/subscribe/{subId}\r
356 \r
357 Response/Error Codes\r
358 ====================\r
359 \r
360 +------------------------+-------------------------------------------+\r
361 | Response statusCode    | Response Description                      |\r
362 +========================+===========================================+\r
363 | 200                    | 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 Publish to Feed\r
402 ---------------\r
403 \r
404 **Description**: Publish a file to a created feed so that it can be shared to any subscribers of that feed\r
405 \r
406 Request URL\r
407 ===========\r
408 \r
409 http[s]://{host}:{port}/publish/{feedId}/{fileName}\r
410 \r
411 * {feedId} is the id of the feed you are publishing to.\r
412 * {fileId} is the id of the file you are publishing onto the feed.\r
413 \r
414 \r
415 Request parameters\r
416 ==================\r
417 \r
418 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
419 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Format             |  Valid/Example Values                |\r
420 +========================+=================================+==================+============+==============+=============+=====================+======================================+\r
421 | feedId                 | ID of the feed you are          |     Path         |   String   |              |     Y       |                     |                                      |\r
422 |                        | publishing to                   |                  |            |              |             |                     |                                      |\r
423 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
424 | fileId                 | Name of the file when it  is    |     Path         |   String   |              |     Y       |                     |                                      |\r
425 |                        | published to subscribers        |                  |            |              |             |                     |                                      |\r
426 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
427 | content-type           | To specify type of message      |     Header       |   String   |     20       |     N       |                     | application/octet-stream             |\r
428 |                        | format                          |                  |            |              |             |                     |                                      |\r
429 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
430 \r
431 Response/Error Codes\r
432 ====================\r
433 \r
434 +------------------------+---------------------------------+\r
435 | Response statusCode    | Response Description            |\r
436 +========================+=================================+\r
437 | 204                    | Successful PUT or DELETE        |\r
438 +------------------------+---------------------------------+\r
439 | 400                    | Failure - Malformed request     |\r
440 +------------------------+---------------------------------+\r
441 | 401                    | Failure - Request was missing   |\r
442 |                        | authorization header, or        |\r
443 |                        | credentials were not accepted   |\r
444 +------------------------+---------------------------------+\r
445 | 403                    | Failure - User could not be     |\r
446 |                        | authenticated, or was not       |\r
447 |                        | authorized to make the request  |\r
448 +------------------------+---------------------------------+\r
449 | 404                    | Failure - Path in the request   |\r
450 |                        | URL did not point to a valid    |\r
451 |                        | feed publishing URL             |\r
452 +------------------------+---------------------------------+\r
453 | 500                    | Failure - DR experienced an     |\r
454 |                        | internal problem                |\r
455 +------------------------+---------------------------------+\r
456 | 503                    | Failure - DR is not currently   |\r
457 |                        | available                       |\r
458 +------------------------+---------------------------------+\r
459 \r
460 Sample Request\r
461 ==============\r
462 \r
463 curl -v -X PUT --user {user}:{password} -H "Content-Type: application/octet-stream" --data-binary @/opt/app/datartr/sampleFile.txt --post301 --location-trusted -k https://{host}:{port}/publish/{feedId}/sampleFile.txt\r
464 \r
465 Feed logging\r
466 ------------\r
467 \r
468 **Description**: View logging information for specified feeds, which can be narrowed down with further parameters\r
469 \r
470 Request URL\r
471 ===========\r
472 \r
473 \r
474 http[s]://{host}:{port}/feedlog/{feedId}?{queryParameter}\r
475 \r
476 * {feedId} is the id of the feed you wish to get logs from\r
477 * {queryParameter} a parameter passed through to narrow the returned logs. multiple parameters can be passed\r
478 \r
479 Request parameters\r
480 ==================\r
481 \r
482 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
483 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Format             |  Valid/Example Values                |\r
484 +========================+=================================+==================+============+==============+=============+=====================+======================================+\r
485 | feedId                 | Id of the feed you want         |     Path         |   String   |              |     N       |                     | 1                                    |\r
486 |                        | logs from                       |                  |            |              |             |                     |                                      |\r
487 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
488 | type                   | Select records of the           |     Path         |   String   |              |     N       |                     | * pub: Publish attempt               |\r
489 |                        | specified type                  |                  |            |              |             |                     | * del: Delivery attempt              |\r
490 |                        |                                 |                  |            |              |             |                     | * exp: Delivery expiry               |\r
491 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
492 | publishId              | Select records with specified   |     Path         |   String   |              |     N       |                     |                                      |\r
493 |                        | publish id, carried in the      |                  |            |              |             |                     |                                      |\r
494 |                        | X-ATT-DR-PUBLISH-ID header from |                  |            |              |             |                     |                                      |\r
495 |                        | original publish request        |                  |            |              |             |                     |                                      |\r
496 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
497 | start                  | Select records created at or    |     Path         |   String   |              |     N       |                     | A date-time expressed in the format  |\r
498 |                        | after specified date            |                  |            |              |             |                     | specified by RFC 3339                |\r
499 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
500 | end                    | Select records created at or    |     Path         |   String   |              |     N       |                     | A date-time expressed in the format  |\r
501 |                        | before specified date           |                  |            |              |             |                     | specified by RFC 3339                |\r
502 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
503 | statusCode             | Select records with the         |     Path         |   String   |              |     N       |                     | An HTTP Integer status code or one   |\r
504 |                        | specified statusCode field      |                  |            |              |             |                     | of the following special values:     |\r
505 |                        |                                 |                  |            |              |             |                     |                                      |\r
506 |                        |                                 |                  |            |              |             |                     | * Success: Any code between 200-299  |\r
507 |                        |                                 |                  |            |              |             |                     | * Redirect: Any code between 300-399 |\r
508 |                        |                                 |                  |            |              |             |                     | * Failure: Any code > 399            |\r
509 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
510 | expiryReason           | Select records with the         |     Path         |   String   |              |     N       |                     |                                      |\r
511 |                        | specified expiry reason         |                  |            |              |             |                     |                                      |\r
512 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
513 \r
514 Response Parameters\r
515 ===================\r
516 \r
517 +------------------------+-------------------------------------------+\r
518 | Name                   | Description                               |\r
519 +========================+===========================================+\r
520 | type                   | Record type:                              |\r
521 |                        |                                           |\r
522 |                        | * pub: publication attempt                |\r
523 |                        | * del: delivery attempt                   |\r
524 |                        | * exp: delivery expiry                    |\r
525 +------------------------+-------------------------------------------+\r
526 | date                   | The UTC date and time at which the record |\r
527 |                        | was generated, with millisecond resolution|\r
528 |                        | in the format specified by RFC 3339       |\r
529 +------------------------+-------------------------------------------+\r
530 | publishId              | The unique identifier assigned by the DR  |\r
531 |                        | at the time of the initial publication    |\r
532 |                        | request (carried in the X-ATT-DRPUBLISH-ID|\r
533 |                        | header in the response to the original    |\r
534 |                        | publish request)                          |\r
535 +------------------------+-------------------------------------------+\r
536 | requestURI             | The Request-URI associated with the       |\r
537 |                        | request                                   |\r
538 +------------------------+-------------------------------------------+\r
539 | method                 | The HTTP method (PUT or DELETE) for the   |\r
540 |                        | request                                   |\r
541 +------------------------+-------------------------------------------+\r
542 | contentType            | The media type of the payload of the      |\r
543 |                        | request                                   |\r
544 +------------------------+-------------------------------------------+\r
545 | contentLength          | The size (in bytes) of the payload of     |\r
546 |                        | the request                               |\r
547 +------------------------+-------------------------------------------+\r
548 | sourceIp               | The IP address from which the request     |\r
549 |                        | originated                                |\r
550 +------------------------+-------------------------------------------+\r
551 | endpointId             | The identity used to submit a publish     |\r
552 |                        | request to the DR                         |\r
553 +------------------------+-------------------------------------------+\r
554 | deliveryId             | The identity used to submit a delivery    |\r
555 |                        | request to a subscriber endpoint          |\r
556 +------------------------+-------------------------------------------+\r
557 | statusCode             | The HTTP status code in the response to   |\r
558 |                        | the request. A value of -1 indicates that |\r
559 |                        | the DR was not able to obtain an HTTP     |\r
560 |                        | status code                               |\r
561 +------------------------+-------------------------------------------+\r
562 | expiryReason           | The reason that delivery attempts were    |\r
563 |                        | discontinued:                             |\r
564 |                        |                                           |\r
565 |                        | * notRetryable: The last delivery attempt |\r
566 |                        |   encountered an error condition for which|\r
567 |                        |   the DR does not make retries.           |\r
568 |                        | * retriesExhausted: The DR reached its    |\r
569 |                        |   limit for making further retry attempts |\r
570 +------------------------+-------------------------------------------+\r
571 | attempts               | Total number of attempts made before      |\r
572 |                        | delivery attempts were discontinued       |\r
573 +------------------------+-------------------------------------------+\r
574 \r
575 Response/Error Codes\r
576 ====================\r
577 \r
578 +------------------------+-------------------------------------------+\r
579 | Response statusCode    | Response Description                      |\r
580 +========================+===========================================+\r
581 | 200                    | Successful query                          |\r
582 +------------------------+-------------------------------------------+\r
583 | 400                    | Bad request - The request is defective in |\r
584 |                        | some way. Possible causes:                |\r
585 |                        |                                           |\r
586 |                        | * Unrecognized parameter name in query    |\r
587 |                        |   string                                  |\r
588 |                        | * Invalid parameter value in query string |\r
589 +------------------------+-------------------------------------------+\r
590 | 404                    | Not Found - The request was not directed  |\r
591 |                        | to a feed log URL or subscription log URL |\r
592 |                        | known to the system                       |\r
593 +------------------------+-------------------------------------------+\r
594 | 405                    | Method not allowed - The HTTP method in   |\r
595 |                        | the request was something other than GET  |\r
596 +------------------------+-------------------------------------------+\r
597 | 406                    | Not Acceptable - The request has an Accept|\r
598 |                        | header indicating that the requester will |\r
599 |                        | not accept a response with                |\r
600 |                        | application/vnd.att-dr.log-list content.  |\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 \r
610 Sample Request\r
611 ==============\r
612 \r
613 curl -v -k https://{host}:{port}/feedlog/{feedId}?statusCode=204\r
614 \r
615 Subscriber logging\r
616 ------------------\r
617 \r
618 **Description**: View logging information for specified subscriptions, which can be narrowed down with further parameters\r
619 \r
620 Request URL\r
621 ===========\r
622 \r
623 \r
624 http[s]://{host}:{port}/sublog/{subId}?{queryParameter}\r
625 \r
626 * {subId} is the id of the feed you wish to get logs from\r
627 * {queryParameter} a parameter passed through to narrow the returned logs. multiple parameters can be passed\r
628 \r
629 Request parameters\r
630 ==================\r
631 \r
632 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
633 | Name                   | Description                     |  Param Type      |  Data Type |   MaxLen     |  Required   |  Format             |  Valid/Example Values                |\r
634 +========================+=================================+==================+============+==============+=============+=====================+======================================+\r
635 | subId                  | Id of the feed you want         |     Path         |   String   |              |     N       |                     | 1                                    |\r
636 |                        | logs from                       |                  |            |              |             |                     |                                      |\r
637 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
638 | type                   | Select records of the           |     Path         |   String   |              |     N       |                     | * pub: Publish attempt               |\r
639 |                        | specified type                  |                  |            |              |             |                     | * del: Delivery attempt              |\r
640 |                        |                                 |                  |            |              |             |                     | * exp: Delivery expiry               |\r
641 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
642 | publishId              | Select records with specified   |     Path         |   String   |              |     N       |                     |                                      |\r
643 |                        | publish id, carried in the      |                  |            |              |             |                     |                                      |\r
644 |                        | X-ATT-DR-PUBLISH-ID header from |                  |            |              |             |                     |                                      |\r
645 |                        | original publish request        |                  |            |              |             |                     |                                      |\r
646 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
647 | start                  | Select records created at or    |     Path         |   String   |              |     N       |                     | A date-time expressed in the format  |\r
648 |                        | after specified date            |                  |            |              |             |                     | specified by RFC 3339                |\r
649 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
650 | end                    | Select records created at or    |     Path         |   String   |              |     N       |                     | A date-time expressed in the format  |\r
651 |                        | before specified date           |                  |            |              |             |                     | specified by RFC 3339                |\r
652 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
653 | statusCode             | Select records with the         |     Path         |   String   |              |     N       |                     | An Http Integer status code or one   |\r
654 |                        | specified statusCode field      |                  |            |              |             |                     | of the following special values:     |\r
655 |                        |                                 |                  |            |              |             |                     |                                      |\r
656 |                        |                                 |                  |            |              |             |                     | * Success: Any code between 200-299  |\r
657 |                        |                                 |                  |            |              |             |                     | * Sedirect: Any code between 300-399 |\r
658 |                        |                                 |                  |            |              |             |                     | * Sailure: Any code > 399            |\r
659 |                        |                                 |                  |            |              |             |                     |                                      |\r
660 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
661 | expiryReason           | Select records with the         |     Path         |   String   |              |     N       |                     |                                      |\r
662 |                        | specified expiry reason         |                  |            |              |             |                     |                                      |\r
663 +------------------------+---------------------------------+------------------+------------+--------------+-------------+---------------------+--------------------------------------+\r
664 \r
665 Response Parameters\r
666 ===================\r
667 \r
668 +------------------------+-------------------------------------------+\r
669 | Name                   | Description                               |\r
670 +========================+===========================================+\r
671 | type                   | Record type:                              |\r
672 |                        |                                           |\r
673 |                        | * pub: publication attempt                |\r
674 |                        | * del: delivery attempt                   |\r
675 |                        | * exp: delivery expiry                    |\r
676 +------------------------+-------------------------------------------+\r
677 | date                   | The UTC date and time at which the record |\r
678 |                        | was generated, with millisecond resolution|\r
679 |                        | in the format specified by RFC 3339       |\r
680 +------------------------+-------------------------------------------+\r
681 | publishId              | The unique identifier assigned by the DR  |\r
682 |                        | at the time of the initial publication    |\r
683 |                        | request (carried in the X-ATT-DRPUBLISH-ID|\r
684 |                        | header in the response to the original    |\r
685 |                        | publish request) to a feed log URL or     |\r
686 |                        | subscription log URL known to the system  |\r
687 +------------------------+-------------------------------------------+\r
688 | requestURI             | The Request-URI associated with the       |\r
689 |                        | request                                   |\r
690 +------------------------+-------------------------------------------+\r
691 | method                 | The HTTP method (PUT or DELETE) for the   |\r
692 |                        | request                                   |\r
693 +------------------------+-------------------------------------------+\r
694 | contentType            | The media type of the payload of the      |\r
695 |                        | request                                   |\r
696 +------------------------+-------------------------------------------+\r
697 | contentLength          | The size (in bytes) of the payload of     |\r
698 |                        | the request                               |\r
699 +------------------------+-------------------------------------------+\r
700 | sourceIp               | The IP address from which the request     |\r
701 |                        | originated                                |\r
702 +------------------------+-------------------------------------------+\r
703 | endpointId             | The identity used to submit a publish     |\r
704 |                        | request to the DR                         |\r
705 +------------------------+-------------------------------------------+\r
706 | deliveryId             | The identity used to submit a delivery    |\r
707 |                        | request to a subscriber endpoint          |\r
708 +------------------------+-------------------------------------------+\r
709 | statusCode             | The HTTP status code in the response to   |\r
710 |                        | the request. A value of -1 indicates that |\r
711 |                        | the DR was not able to obtain an HTTP     |\r
712 |                        | status code                               |\r
713 +------------------------+-------------------------------------------+\r
714 | expiryReason           | The reason that delivery attempts were    |\r
715 |                        | discontinued:                             |\r
716 |                        |                                           |\r
717 |                        | * notRetryable: The last delivery attempt |\r
718 |                        |   encountered an error condition for which|\r
719 |                        |   the DR does not make retries.           |\r
720 |                        | * retriesExhausted: The DR reached its    |\r
721 |                        |   limit for making further retry attempts |\r
722 +------------------------+-------------------------------------------+\r
723 | attempts               | Total number of attempts made before      |\r
724 |                        | delivery attempts were discontinued       |\r
725 +------------------------+-------------------------------------------+\r
726 \r
727 Response/Error Codes\r
728 ====================\r
729 \r
730 +------------------------+-------------------------------------------+\r
731 | Response statusCode    | Response Description                      |\r
732 +========================+===========================================+\r
733 | 200                    | Successful query                          |\r
734 +------------------------+-------------------------------------------+\r
735 | 400                    | Bad request - The request is defective in |\r
736 |                        | some way. Possible causes:                |\r
737 |                        |                                           |\r
738 |                        | * Unrecognized parameter name in query    |\r
739 |                        |   string                                  |\r
740 |                        | * Invalid parameter value in query string |\r
741 +------------------------+-------------------------------------------+\r
742 | 404                    | Not Found - The request was not directed  |\r
743 |                        | to a feed log URL or subscription log URL |\r
744 |                        | known to the system                       |\r
745 +------------------------+-------------------------------------------+\r
746 | 405                    | Method not allowed - The HTTP method in   |\r
747 |                        | the request was something other than GET  |\r
748 +------------------------+-------------------------------------------+\r
749 | 406                    | Not Acceptable - The request has an Accept|\r
750 |                        | header indicating that the requester will |\r
751 |                        | not accept a response with                |\r
752 |                        | application/vnd.att-dr.log-list content.  |\r
753 +------------------------+-------------------------------------------+\r
754 | 500                    | Internal Server Error - The DR API server |\r
755 |                        | encountered an internal error and could   |\r
756 |                        | could not complete the request            |\r
757 +------------------------+-------------------------------------------+\r
758 | 503                    | Service Unavailable - The DR API service  |\r
759 |                        | is currently unavailable                  |\r
760 +------------------------+-------------------------------------------+\r
761 \r
762 Sample Request\r
763 ==============\r
764 \r
765 curl -v -k https://{host}:{port}/sublog/{subscriberId}?statusCode=204