summaryrefslogtreecommitdiffstats
path: root/protocol.txt
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-12-16 19:10:38 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-12-16 19:10:38 +0200
commite4361842fcdec369fbd4466f2528b2815f504ff9 (patch)
tree4694ca56f9e9a4869763d8fe1f31a81f6f62ac0b /protocol.txt
downloadaconf-e4361842fcdec369fbd4466f2528b2815f504ff9.tar.bz2
aconf-e4361842fcdec369fbd4466f2528b2815f504ff9.tar.xz
initial version
Diffstat (limited to 'protocol.txt')
-rw-r--r--protocol.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/protocol.txt b/protocol.txt
new file mode 100644
index 0000000..2ac63b9
--- /dev/null
+++ b/protocol.txt
@@ -0,0 +1,66 @@
+ACF2 HTTP Protocol
+==================
+
+Load JavaScript client:
+req: GET /
+
+Start transaction:
+req: POST /
+resp: txn ID (in header as X-ACF-Transaction-ID)
+ - use X-ACF-Transaction-ID in the header of any subsequent
+ request to process it in the transaction's context
+
+Commit transaction:
+req: POST /
+ X-ACF-Transaction-ID: <txn_id>
+
+Abort transaction:
+req: DELETE /
+ X-ACF-Transaction-ID: <txn_id>
+
+Get object:
+req: GET /config/<obj_path>
+resp: JSON object, with the following attributes:
+ data: JSON serialization of object
+ - primitive types as JSON primitives
+ - references as path names (relative to scope)
+ - models and collections as JSON objects or arrays with
+ members as attributes:
+ - primitive members as JSON primitives
+ - reference, model, and collection members as path names
+ meta: JSON object, with the following attributes
+ - name (last component of path name)
+ - ui-name (shown to user)
+ - description (optional help text)
+ - type (e.g. model, collection, reference, string, number,
+ boolean)
+ - widget (name of client-side JS module used to display
+ the data)
+ - required (boolean)
+ - max-length
+ - choices (optional array of allowed values)
+ - ui-choices (user-friendly choices to be shown in combo
+ boxes)
+ - fields (model only): array of field metadata JSON
+ objects
+ - members (collection only): metadata for members (JSON
+ object)
+ - scope (references only): subtree where the reference can
+ refer to
+
+Create/update object:
+req: PUT /config/<obj_path>
+ - body shall contain the object serialized as the data attribute
+ in GET responses
+ - undefined model attributes are deleted
+
+Delete object:
+req: DELETE /config/<obj_path>
+
+Invoke object-specific action (not yet supported by server):
+req: POST /config/<obj_path>/<action>
+ - arguments passed as a JSON array in body; serialization as in
+ GET responses
+resp: action-specific JSON
+ - for time-consuming actions, can return multiple JSON
+ documents, each containing a status update