Update index documentation file for Datarouter
[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 Message 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 Message 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 \r
31 HTTP Header\r
32 ===========\r
33 \r
34 Specifies HTTP Headers, such as Content-Type, that define the parameters\r
35 of the HTTP Transaction\r
36 \r
37 HTTP Body\r
38 =========\r
39 \r
40 The HTTP Body contains the topic content when Publishing or Consuming.\r
41 The Body may contain topic messages in several formats (like below) but\r
42 it must be noted, that, except in very specific circumstances, messages\r
43 are not inspected for content.\r
44 \r
45 Create a Feed\r
46 -----------\r
47 \r
48 **Description**:Creates the feed\r
49 \r
50 Sample Request\r
51 ==============\r
52 \r
53 curl -v -X POST -H "Content-Type : application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addFeed3.txt --post301 --location-trusted -k https://prov.datarouternew.com:8443\r
54 \r
55 Subscribe to Feed\r
56 -----------\r
57 \r
58 curl -v -X POST -H "Content-Type: application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addSubscriber.txt --post301 --location-trusted -k https://prov.datarouternew.com:8443/subscribe/1\r
59 \r
60 Sample Request\r
61 ==============\r
62 \r
63 POST http(s)://{HOST:PORT}/events/{topicname}\r
64 \r
65 Publish to feed\r
66 -----------\r
67 \r
68 **Description**:publish  the feed\r
69 \r
70 Sample Request\r
71 ==============\r
72 \r
73 curl -v -X PUT --user rs873m:rs873m -H "Content-Type: application/octet-stream" --data-binary @/opt/app/datartr/addFeed3.txt --post301 --location-trusted -k https://prov.datarouternew.com:8443/publish/1/test1\r