提交 65b3927f authored 作者: Anthony Minessale's avatar Anthony Minessale

updates for events

上级 69b45859
......@@ -37,7 +37,7 @@ Sec-WebSocket-Protocol: blade-1.0
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
"realm-list": [{"realm": "ls1.mydomain.com"}]
"allowed-blapi": ["BLADE"],
"allowed-protocol": ["BLADE"],
}
}
......@@ -73,7 +73,7 @@ Sec-WebSocket-Protocol: blade-1.0
"jsonrpc": "2.0",
"method": "BLADE.register",
"params": {
"realm-zone": "myspace",
"sub-realm": "myspace",
"realm": "ls1.mydomain.com",
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
......@@ -86,9 +86,9 @@ Sec-WebSocket-Protocol: blade-1.0
"jsonrpc": "2.0",
"id": 3,
"result": {
"realm-zone": "myspace",
"sub-realm": "myspace",
"realm": "ls1.mydomain.com",
"realm-list": [{"realm": "ls1.mydomain.com", "zones": ["myspace"]}],
"realm-list": [{"realm": "ls1.mydomain.com", "sub-realms": ["myspace"]}],
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
}
......@@ -96,13 +96,13 @@ Sec-WebSocket-Protocol: blade-1.0
---> PUBLISH API LSAPI "A single node must have exlusive access to the BLAPI's namespace with the master to publish"
---> PUBLISH API LSAPI "A single node must have exlusive access to the PROTOCOL's namespace with the master to publish"
// MAYBE ADD SCHEMA and method to fetch it.
{
"jsonrpc": "2.0",
"method": "BLADE.publish",
"params": {
"blapi": "LSAPI",
"protocol": "LSAPI",
"realm": "ls1.mydomain.com",
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
......@@ -116,8 +116,8 @@ Sec-WebSocket-Protocol: blade-1.0
"jsonrpc": "2.0",
"id": 4,
"result": {
"blapi": "LSAPI",
"allowed-blapi": ["BLADE", "LSAPI"],
"protocol": "LSAPI",
"allowed-protocol": ["BLADE", "LSAPI"],
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
}
......@@ -130,7 +130,8 @@ Sec-WebSocket-Protocol: blade-1.0
"jsonrpc": "2.0",
"method": "BLADE.execute",
"params": {
"blapi": "LSAPI",
"realm": "ls1.mydomain.com",
"protocol": "LSAPI",
"params": {
"path": "/tmp/testing"
}
......@@ -145,10 +146,51 @@ Sec-WebSocket-Protocol: blade-1.0
"jsonrpc": "2.0",
"id": 5,
"result": {
"blapi": "LSAPI",
"realm": "ls1.mydomain.com",
"protocol": "LSAPI",
"result": {
"listing": "-rw-r--r-- 1 root root 33881 May 3 17:22 blank_avatar.png\ndrwxr-xr-x 6 root root 4096 Oct 26 2016 dash.js\n-rw-r--r-- 1 root root 5266 May 3 17:20 foo.diff\n-rw-r--r-- 1 root root 485 May 3 17:22 ks.diff"
},
}
}
Endpoints subscribe to event channels on their Master.
If that Master is not the top tier Master, it in turn subscribes all of its distinct events to it's Master until it reaches the top tier.
When the Master is encounterd who holds a connection to the Controller for a particular protocol, the Master subscribes to that Controller.
---> EVENT SUB
{
"jsonrpc": "2.0",
"method": "BLADE.subscribe",
"params": {
"realm": "ls1.mydomain.com",
"protocol": "LSAPI",
"event-space": "LSAPI",
"params": {
"eventChannel": "someEvent",
"subParams": {"foo": "bar"}
}
"session-id": "5b696e8d-9875-45a5-b347-3b9fc288bad3",
"master-id": "5164f7f8-a6ca-4dd4-8f36-33db1dc9c35d",
},
"id": 6
}
<--- SUCCESS (TBD FAIL CASE)
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"realm": "ls1.mydomain.com",
"protocol": "LSAPI",
"event-space": "LSAPI",
"result": {
"subscribedChannels": ["someEvent"],
"unauthorizedChannels": [],
"alreadySubscribedChannels": []
},
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论