Protocol.md in arborist-0.0.1.pre20160128152542 vs Protocol.md in arborist-0.0.1.pre20160606141735
- old
+ new
@@ -1,8 +1,8 @@
# Monitors
-## Protocol
+## Basic Protocol
ZMQ REQ socket, msgpack message consisting of an Array of two elements:
[
header,
@@ -18,12 +18,30 @@
}
Body is either Nil, a Map of key-value pairs, or an Array of Maps appropriate to the `action`.
-## status
+## Commands
+
+### «commandname»
+
+«description»
+
+#### Header
+
+#### Body
+
+#### Return
+
+#### Examples
+
+
+
+
+### status
+
Fetch the status of the Manager.
{
action: status,
version: 1,
@@ -41,19 +59,26 @@
uptime: 17155,
nodecount: 342
}
-## list
+### list
+Retrieve an Array of Maps that describes all or part of the node tree.
+
+#### Required
+ from the node with the specified `identifier`, or the root node if no `identifier` is specified.
+
+
Request:
[
{
action: list,
version: 1
[from: «identifier»]
+ [depth: «arg»]
}
]
Successful response:
@@ -87,15 +112,13 @@
category: either 'server' or 'client', meaning who is responsible for the error
version: 1
}
]
-Fetch a data structure describing the node tree from the node with the specified
-`identifier`, or the root node if no `identifier` is specified.
-## fetch
+### fetch
Fetch the `address`, `description`, and `status` of all nodes.
[
{
@@ -117,20 +140,20 @@
}
]
]
-### return
+#### return
- not specified : returns everything.
- `Nil` : returns just identifiers
- array of fields : returns the values of those fields
Search for nodes that match the filter given in the request body, returning a serialized map of node identifiers to requested state.
-## update
+### update
[
{
action: update,
version: 1
@@ -162,11 +185,11 @@
}
}
]
-## subscribe
+### subscribe
Get node change delta events for every 'host' type node.
{
action: subscribe,
@@ -209,6 +232,42 @@
version: 1,
event_type: sys.*
},
Nil
+
+### graft
+
+ {
+ action: graft,
+ version: 1,
+ type: 'host',
+ identifier: 'joliet',
+ parent: 'bennett' # defaults to root
+ },
+ {
+ addresses: [],
+ tags: []
+ }
+
+
+### prune
+
+ {
+ action: prune,
+ version: 1,
+ identifier: 'bennett'
+ },
+ Nil
+
+
+### modify
+
+ {
+ action: modify,
+ version: 1,
+ identifier: 'bennett'
+ },
+ {
+ addresses: ['10.13.0.22', '10.1.0.23']
+ }