Group: GNU Social P2P/Design/Agent2RemoteCore
m (→get) |
|||
Line 47: | Line 47: | ||
{ success: true, value: $value, $path_keys } | { success: true, value: $value, $path_keys } | ||
+ | or | ||
+ | { success: false, message: "why" } | ||
+ | |||
+ | ==== scan ==== | ||
+ | |||
+ | Request the paths at a subtree: | ||
+ | |||
+ | GET '/scan', { | ||
+ | route: $route, | ||
+ | body: { | ||
+ | friend_id: $friend_id, | ||
+ | path: $path, | ||
+ | end_path: $end_path, | ||
+ | max: $max, | ||
+ | order: $order, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | result is: | ||
+ | |||
+ | { success: true, paths: [$path*], $path_keys } | ||
or | or | ||
{ success: false, message: "why" } | { success: false, message: "why" } |
Revision as of 18:38, 31 May 2010
Core to Core
Remember that values are opaque to Cores.
HTTP REST
A simple binding over HTTP REST. All {} enclosed structures are JSON encoded.
$route = { uri: $destURI }
send
Notify a remote of a new value at a certain path.
$path_keys = [ $path_key* ]
path_keys is an array of encrypted path keys that would enable the friend's UI to decrypt the value. It starts with a path_key encrypted with the friend's public key.
POST '/send', { route: $route, body: recipient, { path: $path, path_keys: $path_keys, value: $value, } }
result is:
{ success: true }
or
{ success: false, message: "why" }
get
Request the value at a certain path.
GET '/get', { route: $route, body: { friend_id: $friend_id, path: $path, } }
result is:
{ success: true, value: $value, $path_keys }
or
{ success: false, message: "why" }
scan
Request the paths at a subtree:
GET '/scan', { route: $route, body: { friend_id: $friend_id, path: $path, end_path: $end_path, max: $max, order: $order, } }
result is:
{ success: true, paths: [$path*], $path_keys }
or
{ success: false, message: "why" }