##// END OF EJS Templates
Changed protocol a bit to be more clear and universal
neko259 -
r778:e7f72600 decentral
parent child Browse files
Show More
@@ -1,12 +1,16 b''
1 <request>
1 <request>
2 <version>
2 <version>
3 <protocol>1</protocol>
3 <protocol>1</protocol>
4 <models>
4 <models>
5 <post>1</post>
5 <post>1</post>
6 </models>
6 </models>
7 </version>
7 </version>
8 <data>
8 <data>
9 <type>get</type>
10 <model>post</model>
11 <options>
9 <id>id1/1</id>
12 <id>id1/1</id>
10 <id>id2/56</id>
13 <id>id2/56</id>
14 </options>
11 </data>
15 </data>
12 </request>
16 </request>
@@ -1,26 +1,32 b''
1 <?xml version="1.1" encoding="UTF-8" ?>
1 <?xml version="1.1" encoding="UTF-8" ?>
2 <request>
2 <request>
3 <version>
3 <version>
4 <protocol>1</protocol>
4 <protocol>1</protocol>
5 <models>
5 <models>
6 <post>1</post>
6 <post>1</post>
7 </models>
7 </models>
8 </version>
8 </version>
9 <data>
9 <data>
10 <!-- Request type -->
10 <type>pull</type>
11 <type>pull</type>
11 <timestamp>0</timestamp>
12 <!-- Model which we wish to pull -->
13 <model>post</model>
14 <options>
15 <timestamp_from>0</timestamp_from>
16 <timestamp_to>0</timestamp_to>
17 <tags>
18 <tag>tag1</tag>
19 </tags>
20 </options>
12 <hosts>
21 <hosts>
13 <allow>
22 <allow>
14 <host>*</host>
23 <host>*</host>
15 </allow>
24 </allow>
16 <deny></deny>
25 <deny></deny>
17 <pools>
26 <pools>
18 <pool>test1</pool>
27 <pool>test1</pool>
19 <pool>test2</pool>
28 <pool>test2</pool>
20 </pools>
29 </pools>
21 <tags>
22 <tag>tag1</tag>
23 </tags>
24 </hosts>
30 </hosts>
25 </data>
31 </data>
26 </request>
32 </request>
1 NO CONTENT: file renamed from docs/samples/response_post.xml to docs/samples/response_get.xml
NO CONTENT: file renamed from docs/samples/response_post.xml to docs/samples/response_get.xml
@@ -1,32 +1,29 b''
1 # INTRO #
1 # INTRO #
2
2
3 This document discribes the server sync protocol.
3 This document discribes the server sync protocol.
4
4
5 # DRAFT PROTOCOL DESCRIPTION #
5 # DRAFT PROTOCOL DESCRIPTION #
6
6
7 Version:
8 * Protocol version
9 * Model version
10
11 Node data:
12 * Public key
13
14 Object data:
15 * Post
16 * Post list (for sync)
17
18 The node requests other node's changes list since some time (since epoch if
7 The node requests other node's changes list since some time (since epoch if
19 this is the start). The other node sends a list of post ids or posts in the
8 this is the start). The other node sends a list of post ids or posts in the
20 XML or JSON format.
9 XML or JSON format.
21
10
22 Protocol version is the version of the sync api. Model version is the version
11 Protocol version is the version of the sync api. Model version is the version
23 of data models. If at least one of them is different, the sync cannot be
12 of data models. If at least one of them is different, the sync cannot be
24 performed.
13 performed.
25
14
26 The node signs the data with its key. The receiving node saves the key at the
15 The node signs the data with its key. The receiving node saves the key at the
27 first sync and checks it every time. If the key has changed, the info won't be
16 first sync and checks it every time. If the key has changed, the info won't be
28 saved from the node (or the node id must be changed).
17 saved from the node (or the node id must be changed).
29
18
30 Each node holds a list of networks it wants to get info from.
19 Each node holds a list of networks it wants to get info from.
31
20
32 Each post has an ID in the unique format: node-id/post-id
21 Each post has an ID in the unique format: node-id/post-id
22
23 All requests pass a request type, protocol and model versions and a list of
24 optional arguments used for filtering.
25
26 # REQUESTS #
27 Request types:
28 * pull - pull the desired model ids
29 * get - get models by ids
General Comments 0
You need to be logged in to leave comments. Login now