Difference between revisions of "Deployment Platform/Sneakernet/Packets format"
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
== Record types == | == Record types == | ||
− | * ' | + | * Push changes of Sugar Network resource's properties. |
− | :* {{Code|cmd}}: {{Code| | + | :* {{Code|cmd: sn_push}}; |
− | :* {{Code| | + | :* {{Code|content_type: records}}; |
− | :* {{Code| | + | :* {{Code|document}}, Sugar Network resource to push diff to; |
− | :* {{Code| | + | :* {{Code|guid}}, document GUID to push diff for; |
+ | :* {{Code|diff}}, dictionary of {{Code|<prop_name>: {"value": <value>, "mtime": <mtime>}}} with changed property values. | ||
* '''ACK''' packet: | * '''ACK''' packet: | ||
Line 31: | Line 32: | ||
:* {{Code|pull_sequence}}: Sequence after merging original PUSH packet | :* {{Code|pull_sequence}}: Sequence after merging original PUSH packet | ||
− | * | + | * Pull Sugar Network data. |
:* {{Code|cmd: sn_pull}}; | :* {{Code|cmd: sn_pull}}; | ||
:* {{Code|sequence}}: sequence to pull. | :* {{Code|sequence}}: sequence to pull. | ||
− | * | + | * Pull files from shared directory. |
:* {{Code|cmd: files_pull}}; | :* {{Code|cmd: files_pull}}; | ||
:* {{Code|directory}}, synchronized directory to pull; | :* {{Code|directory}}, synchronized directory to pull; | ||
:* {{Code|sequence}}, sequence to pull. | :* {{Code|sequence}}, sequence to pull. |
Revision as of 11:40, 27 July 2012
Packets format
Packets are tarball files with .packet
suffix.
On logic level, every packet consists of:
- one header, a dictionary of key-value pairs;
- records, a dictionary of key-value pairs and optional data depending on record type.
Header
Header is being stored in JSON notation in /header
file in packet tarball.
src
, sender's GUIDdst
, optional destination GUIDfilename
, suggested file name for packet file, it is assumed to be unique
Record types
- Push changes of Sugar Network resource's properties.
cmd: sn_push
;content_type: records
;document
, Sugar Network resource to push diff to;guid
, document GUID to push diff for;diff
, dictionary of<prop_name>: {"value": <value>, "mtime": <mtime>
} with changed property values.
- ACK packet:
type
:ack
src
: master's identitydst
: receiver's identity ack is intended forpush_sequence
: original PUSH packet's sequencepull_sequence
: Sequence after merging original PUSH packet
- Pull Sugar Network data.
cmd: sn_pull
;sequence
: sequence to pull.
- Pull files from shared directory.
cmd: files_pull
;directory
, synchronized directory to pull;sequence
, sequence to pull.