Repository navigation
Expand file tree
/
Copy pathframes.json
More file actions
198 lines (198 loc) · 5.72 KB
/
Copy pathframes.json
File metadata and controls
198 lines (198 loc) · 5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
{
"$defs": {
"Call": {
"additionalProperties": false,
"description": "Start a call.",
"properties": {
"body": {
"description": "The whole request message as proto3 JSON (path and query parameters are fields of it); absent or null is an empty message. Unknown fields are refused.",
"type": [
"object",
"null"
]
},
"id": {
"description": "The client's handle for the call, unique among its calls in flight; free again after the call's `end` or `error`.",
"minLength": 1,
"type": "string"
},
"method": {
"description": "The RPC's full name, `iohr.events.v1.EventsService/StreamEvents`: the operation's `x-iohr-rpc` in /openapi.json.",
"type": "string"
},
"type": {
"const": "call"
}
},
"required": [
"type",
"id",
"method"
],
"type": "object"
},
"Cancel": {
"additionalProperties": false,
"description": "Stop a call in flight. It ends with `end`, like any other.",
"properties": {
"id": {
"description": "The client's handle for the call, unique among its calls in flight; free again after the call's `end` or `error`.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "cancel"
}
},
"required": [
"type",
"id"
],
"type": "object"
},
"ClientFrame": {
"description": "A frame the client sends.",
"discriminator": {
"propertyName": "type"
},
"oneOf": [
{
"$ref": "#/$defs/Call"
},
{
"$ref": "#/$defs/Cancel"
}
]
},
"Data": {
"description": "One response message: the same JSON the REST route answers, or one event of its stream.",
"properties": {
"body": {
"type": "object"
},
"id": {
"description": "The client's handle for the call, unique among its calls in flight; free again after the call's `end` or `error`.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "data"
}
},
"required": [
"type",
"id",
"body"
],
"type": "object"
},
"End": {
"description": "The call is over and its id is free again.",
"properties": {
"id": {
"description": "The client's handle for the call, unique among its calls in flight; free again after the call's `end` or `error`.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "end"
}
},
"required": [
"type",
"id"
],
"type": "object"
},
"Error": {
"description": "The call failed, or a frame did not make sense; the keys are the REST error envelope's. Without `id` it concerns the socket: one sent as the server ends the socket (a revoked key: `unauthenticated`; the longest life: `unavailable`) precedes the close.",
"properties": {
"code": {
"description": "The error code; a client keeps a code it does not know.",
"examples": [
"bad_request",
"not_found",
"already_exists",
"conflict",
"forbidden",
"unauthenticated",
"rate_limited",
"quota_exceeded",
"failed_precondition",
"unimplemented",
"unavailable",
"timeout",
"cancelled",
"internal",
"unsupported_media_type",
"payload_too_large",
"method_not_allowed",
"unprocessable",
"upgrade_required"
],
"type": "string"
},
"details": {
"description": "Typed details, the REST envelope's `details` (`Problem` in /openapi.json).",
"items": {
"type": "object"
},
"type": "array"
},
"error": {
"description": "A sentence for a person.",
"type": "string"
},
"id": {
"description": "The client's handle for the call, unique among its calls in flight; free again after the call's `end` or `error`.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "error"
}
},
"required": [
"type",
"code",
"error",
"details"
],
"type": "object"
},
"ServerFrame": {
"description": "A frame the server sends.",
"discriminator": {
"propertyName": "type"
},
"oneOf": [
{
"$ref": "#/$defs/Data"
},
{
"$ref": "#/$defs/End"
},
{
"$ref": "#/$defs/Error"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "The multiplexed socket at /v1/ws: every public RPC over one WebSocket, many calls at once told apart by the client's id. Text frames, one JSON object each. A client sends `call` and `cancel`; the server answers each call with `data` frames (one for a unary RPC, one per message for a stream) and exactly one `end` or `error`. A key or scoped token calls what its scopes admit, the same routes as on REST; anything else is an `error` frame with code `forbidden`. The identity is fixed at the upgrade.",
"oneOf": [
{
"$ref": "#/$defs/ClientFrame"
},
{
"$ref": "#/$defs/ServerFrame"
}
],
"title": "The /v1/ws frames",
"x-iohr-limits": {
"idle_timeout_seconds": 300,
"max_calls": 64,
"max_frame_bytes": 262144,
"ping_every_seconds": 15
}
}