@nosana/types 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/Common/index.d.ts +3 -0
- package/dist/Common/index.d.ts.map +1 -1
- package/dist/Common/index.js +6 -0
- package/dist/Common/index.js.map +1 -1
- package/dist/Schemas/index.d.ts +3 -0
- package/dist/Schemas/index.d.ts.map +1 -1
- package/dist/Schemas/index.js +1 -0
- package/dist/Schemas/index.js.map +1 -1
- package/dist/Schemas/node.d.ts +1826 -0
- package/dist/Schemas/node.d.ts.map +1 -0
- package/dist/Schemas/node.js +2 -0
- package/dist/Schemas/node.js.map +1 -0
- package/dist/Schemas/nodeOpenApi.d.ts +71 -0
- package/dist/Schemas/nodeOpenApi.d.ts.map +1 -0
- package/dist/Schemas/nodeOpenApi.js +1654 -0
- package/dist/Schemas/nodeOpenApi.js.map +1 -0
- package/openapi/node.openapi.json +3429 -0
- package/package.json +5 -3
|
@@ -0,0 +1,1654 @@
|
|
|
1
|
+
import typia from "typia";
|
|
2
|
+
import { SOLANA_ADDRESS_PATTERN } from "../Common/index.js";
|
|
3
|
+
const ref = (name) => ({ $ref: `#/components/schemas/${name}` });
|
|
4
|
+
const json = (description, schema) => ({ description, content: { "application/json": { schema } } });
|
|
5
|
+
const text = (description) => ({ description, content: { "text/plain": { schema: { type: "string" } } } });
|
|
6
|
+
const sse = (description) => ({ description, content: { "text/event-stream": { schema: { type: "string" } } } });
|
|
7
|
+
const err = (description) => json(description, ref("NodeError"));
|
|
8
|
+
const nullable = (type) => ({ oneOf: [{ type }, { type: "null" }] });
|
|
9
|
+
const job = { name: "job", in: "path", required: true, description: "The job's address.", schema: ref("Address") };
|
|
10
|
+
const group = { name: "group", in: "path", required: true, description: "A group of the job definition.", schema: { type: "string" } };
|
|
11
|
+
const op = { name: "op", in: "path", required: true, description: "An operation id within the job definition.", schema: { type: "string" } };
|
|
12
|
+
const interval = { name: "interval", in: "query", description: "Seconds between samples.", schema: { type: "integer", minimum: 1 } };
|
|
13
|
+
const millis = (name, description) => ({ name, in: "query", description, schema: { type: "integer" } });
|
|
14
|
+
const OWNER = [{ NosanaAuthorization: [] }];
|
|
15
|
+
const NOT_FOUND = err("No running job with that address, or the id is not part of it.");
|
|
16
|
+
const UNAUTHORIZED = err("The authorization header is missing, invalid, or not signed by the job's owner.");
|
|
17
|
+
const NO_SSH_JOB = err("No active job with SSH access.");
|
|
18
|
+
const NOT_APPLIED = err("The node could not apply the change.");
|
|
19
|
+
const jobErrors = { "400": NOT_FOUND, "401": UNAUTHORIZED };
|
|
20
|
+
function operation(operationId, tag, summary, description, responses, extra = {}) {
|
|
21
|
+
return {
|
|
22
|
+
operationId,
|
|
23
|
+
tags: [tag],
|
|
24
|
+
summary,
|
|
25
|
+
description,
|
|
26
|
+
parameters: extra.params ?? [],
|
|
27
|
+
...(extra.body ? { requestBody: { required: true, content: { "application/json": { schema: extra.body } } } } : {}),
|
|
28
|
+
responses,
|
|
29
|
+
security: extra.public ? [] : OWNER,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** What the node itself defines; everything a job definition or flow contains comes from typia below. */
|
|
33
|
+
const ownSchemas = {
|
|
34
|
+
Address: { type: "string", pattern: SOLANA_ADDRESS_PATTERN, description: "A Solana address in base58." },
|
|
35
|
+
NodeError: {
|
|
36
|
+
description: "The node answers failures with a sentence or with `{ error }`.",
|
|
37
|
+
oneOf: [{ type: "string" }, { type: "object", required: ["error"], properties: { error: { type: "string" } } }],
|
|
38
|
+
},
|
|
39
|
+
NodeInfo: {
|
|
40
|
+
type: "object",
|
|
41
|
+
required: ["state", "info", "resources"],
|
|
42
|
+
additionalProperties: true,
|
|
43
|
+
properties: {
|
|
44
|
+
state: { type: "string", description: "What the node is doing right now, as classified by its monitor." },
|
|
45
|
+
info: {
|
|
46
|
+
type: "object",
|
|
47
|
+
additionalProperties: true,
|
|
48
|
+
properties: {
|
|
49
|
+
gpus: {
|
|
50
|
+
type: "object",
|
|
51
|
+
additionalProperties: true,
|
|
52
|
+
properties: {
|
|
53
|
+
devices: {
|
|
54
|
+
type: "array",
|
|
55
|
+
items: {
|
|
56
|
+
type: "object",
|
|
57
|
+
additionalProperties: true,
|
|
58
|
+
properties: { index: { type: "integer" }, name: { type: "string" }, uuid: { type: "string" }, memory: {}, network_architecture: {} },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
network: { type: "object", additionalProperties: true, description: "Network details with the IP address redacted." },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
resources: {
|
|
67
|
+
type: "object",
|
|
68
|
+
required: ["images", "volumes"],
|
|
69
|
+
properties: { images: { type: "array", items: { type: "string" } }, volumes: { type: "array", items: { type: "string" } } },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
OpStateSummary: {
|
|
74
|
+
type: "object",
|
|
75
|
+
description: "An operation's state as the info stream sends it: `OpState` without its logs and provider handle.",
|
|
76
|
+
properties: {
|
|
77
|
+
operationId: nullable("string"),
|
|
78
|
+
group: nullable("string"),
|
|
79
|
+
status: nullable("string"),
|
|
80
|
+
startTime: nullable("integer"),
|
|
81
|
+
endTime: nullable("integer"),
|
|
82
|
+
exitCode: nullable("integer"),
|
|
83
|
+
results: { type: "object", additionalProperties: { oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] } },
|
|
84
|
+
error: { type: "object", required: ["event", "message"], properties: { event: { type: "string" }, message: { type: "string" }, code: { type: "integer" } } },
|
|
85
|
+
diagnostics: { type: "object", required: ["reason"], properties: { reason: ref("DiagnosticsReason"), state: ref("DiagnosticsState") } },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
OperationStatuses: { type: "object", description: "Status per operation, keyed by operation id.", additionalProperties: nullable("string") },
|
|
89
|
+
JobInfo: {
|
|
90
|
+
type: "object",
|
|
91
|
+
description: "One frame of the job info stream: the flow without logs, plus task status.",
|
|
92
|
+
required: ["status", "startTime", "endTime", "errors", "opStates", "operations"],
|
|
93
|
+
properties: {
|
|
94
|
+
status: { type: "string" },
|
|
95
|
+
startTime: { type: "integer" },
|
|
96
|
+
endTime: nullable("integer"),
|
|
97
|
+
errors: { type: "array", items: {} },
|
|
98
|
+
opStates: { type: "array", items: ref("OpStateSummary") },
|
|
99
|
+
secrets: ref("FlowSecrets"),
|
|
100
|
+
operations: {
|
|
101
|
+
oneOf: [
|
|
102
|
+
{
|
|
103
|
+
type: "object",
|
|
104
|
+
required: ["all", "currentGroupStatus"],
|
|
105
|
+
properties: {
|
|
106
|
+
all: { oneOf: [ref("OperationStatuses"), { type: "null" }] },
|
|
107
|
+
currentGroup: { type: "string" },
|
|
108
|
+
currentGroupStatus: { oneOf: [ref("OperationStatuses"), { type: "null" }] },
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{ type: "null" },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
JobEndpoints: {
|
|
117
|
+
type: "object",
|
|
118
|
+
required: ["urls", "status"],
|
|
119
|
+
properties: { urls: ref("JobExposeSecrets"), status: { type: "string", enum: ["ONLINE", "OFFLINE"] } },
|
|
120
|
+
},
|
|
121
|
+
TaskStat: {
|
|
122
|
+
type: "object",
|
|
123
|
+
required: ["opId", "timestamp", "cpu", "memory", "disk", "network"],
|
|
124
|
+
properties: {
|
|
125
|
+
opId: { type: "string" },
|
|
126
|
+
timestamp: { type: "integer", description: "Unix milliseconds." },
|
|
127
|
+
cpu: { type: "object", required: ["cpu_percent"], properties: { cpu_percent: { type: "number" } } },
|
|
128
|
+
memory: {
|
|
129
|
+
type: "object",
|
|
130
|
+
required: ["memory_usage", "memory_limit", "memory_percent"],
|
|
131
|
+
properties: { memory_usage: { type: "number" }, memory_limit: { type: "number" }, memory_percent: { type: "number" } },
|
|
132
|
+
},
|
|
133
|
+
disk: { type: "object", required: ["read", "write"], properties: { read: { type: "number" }, write: { type: "number" } } },
|
|
134
|
+
network: { type: "object", required: ["received", "sent"], properties: { received: { type: "number" }, sent: { type: "number" } } },
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
TaskLog: {
|
|
138
|
+
type: "object",
|
|
139
|
+
required: ["opId", "group", "type", "timestamp", "message"],
|
|
140
|
+
properties: { opId: { type: "string" }, group: { type: "string" }, type: { type: "string" }, timestamp: { type: "integer" }, message: {} },
|
|
141
|
+
},
|
|
142
|
+
ActionResult: { type: "object", required: ["message"], properties: { message: { type: "string" } } },
|
|
143
|
+
SshPublicKey: {
|
|
144
|
+
type: "string",
|
|
145
|
+
maxLength: 8192,
|
|
146
|
+
description: "One OpenSSH `authorized_keys` line: algorithm, base64 key material and an optional comment.",
|
|
147
|
+
},
|
|
148
|
+
SshAuthorizationRequest: {
|
|
149
|
+
type: "object",
|
|
150
|
+
required: ["sshPublicKey"],
|
|
151
|
+
properties: {
|
|
152
|
+
sshPublicKey: ref("SshPublicKey"),
|
|
153
|
+
expiresAt: { type: "string", format: "date-time", description: "Omit for access until the key is revoked or the job ends." },
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
SshAuthorization: {
|
|
157
|
+
type: "object",
|
|
158
|
+
required: ["job", "sshUser", "authorized"],
|
|
159
|
+
properties: {
|
|
160
|
+
job: ref("Address"),
|
|
161
|
+
sshUser: { type: "string", description: "Always `nosana`; the hostname identifies the job and operation." },
|
|
162
|
+
authorized: { type: "boolean", const: true },
|
|
163
|
+
expiresAt: { type: "string", format: "date-time" },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
SshAuthorizedKey: {
|
|
167
|
+
type: "object",
|
|
168
|
+
required: ["sshPublicKey"],
|
|
169
|
+
properties: { sshPublicKey: ref("SshPublicKey"), expiresAt: { type: "string", format: "date-time", description: "Absent for permanent keys." } },
|
|
170
|
+
},
|
|
171
|
+
SshKeys: {
|
|
172
|
+
type: "object",
|
|
173
|
+
required: ["job", "sshUser", "keys"],
|
|
174
|
+
properties: { job: ref("Address"), sshUser: { type: "string" }, keys: { type: "array", items: ref("SshAuthorizedKey") } },
|
|
175
|
+
},
|
|
176
|
+
SshRevocationRequest: { type: "object", required: ["sshPublicKey"], properties: { sshPublicKey: ref("SshPublicKey") } },
|
|
177
|
+
SshRevocation: {
|
|
178
|
+
type: "object",
|
|
179
|
+
required: ["job", "sshUser", "revoked"],
|
|
180
|
+
properties: { job: ref("Address"), sshUser: { type: "string" }, revoked: { type: "boolean", const: true } },
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
/** OpenAPI component names may only use letters, digits, `.`, `-` and `_`; typia names generic records with more. */
|
|
184
|
+
const componentName = (name) => name.replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
185
|
+
/** Renames the components in place; the collection is freshly built by typia, so nothing else holds it. */
|
|
186
|
+
function withSafeNames(schemas) {
|
|
187
|
+
rewriteRefs(schemas);
|
|
188
|
+
return Object.fromEntries(Object.entries(schemas).map(([name, schema]) => [componentName(name), schema]));
|
|
189
|
+
}
|
|
190
|
+
function rewriteRefs(value) {
|
|
191
|
+
if (Array.isArray(value)) {
|
|
192
|
+
value.forEach(rewriteRefs);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (typeof value !== "object" || value === null)
|
|
196
|
+
return;
|
|
197
|
+
const record = value;
|
|
198
|
+
for (const [key, entry] of Object.entries(record)) {
|
|
199
|
+
if (key === "$ref" && typeof entry === "string") {
|
|
200
|
+
record[key] = entry.replace(/^#\/components\/schemas\/(.+)$/, (_, name) => `#/components/schemas/${componentName(name)}`);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
rewriteRefs(entry);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
let document;
|
|
208
|
+
/** The document, built on first use and then reused. */
|
|
209
|
+
export function nodeOpenApiDocument() {
|
|
210
|
+
return (document ?? (document = buildDocument()));
|
|
211
|
+
}
|
|
212
|
+
function buildDocument() {
|
|
213
|
+
/** `JobDefinition`, `FlowState` and everything they reach, straight from the TypeScript types. */
|
|
214
|
+
const jobSchemas = {
|
|
215
|
+
version: "3.1",
|
|
216
|
+
components: {
|
|
217
|
+
schemas: {
|
|
218
|
+
JobDefinition: {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
version: {
|
|
222
|
+
"const": "0.1"
|
|
223
|
+
},
|
|
224
|
+
type: {
|
|
225
|
+
"const": "container"
|
|
226
|
+
},
|
|
227
|
+
logistics: {
|
|
228
|
+
$ref: "#/components/schemas/Logistics"
|
|
229
|
+
},
|
|
230
|
+
deployment_id: {
|
|
231
|
+
type: "string"
|
|
232
|
+
},
|
|
233
|
+
ssh: {
|
|
234
|
+
$ref: "#/components/schemas/SSH"
|
|
235
|
+
},
|
|
236
|
+
meta: {
|
|
237
|
+
$ref: "#/components/schemas/Meta"
|
|
238
|
+
},
|
|
239
|
+
global: {
|
|
240
|
+
$ref: "#/components/schemas/Global"
|
|
241
|
+
},
|
|
242
|
+
ops: {
|
|
243
|
+
$ref: "#/components/schemas/Ops"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
required: [
|
|
247
|
+
"version",
|
|
248
|
+
"type",
|
|
249
|
+
"ops"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
Logistics: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
send: {
|
|
256
|
+
$ref: "#/components/schemas/Logistic"
|
|
257
|
+
},
|
|
258
|
+
receive: {
|
|
259
|
+
$ref: "#/components/schemas/Logistic"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
required: [
|
|
263
|
+
"send",
|
|
264
|
+
"receive"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
Logistic: {
|
|
268
|
+
type: "object",
|
|
269
|
+
properties: {
|
|
270
|
+
type: {
|
|
271
|
+
$ref: "#/components/schemas/LogisticType"
|
|
272
|
+
},
|
|
273
|
+
args: {
|
|
274
|
+
$ref: "#/components/schemas/Partial__type"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
required: [
|
|
278
|
+
"type",
|
|
279
|
+
"args"
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
LogisticType: {
|
|
283
|
+
oneOf: [
|
|
284
|
+
{
|
|
285
|
+
"const": "api"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"const": "api-listen"
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
description: "api - we receive and send via an endpoint endpoint\napi-listen - we create an endpoint to listen for incoming requests"
|
|
292
|
+
},
|
|
293
|
+
Partial__type: {
|
|
294
|
+
type: "object",
|
|
295
|
+
properties: {
|
|
296
|
+
endpoint: {
|
|
297
|
+
type: "string"
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
required: [],
|
|
301
|
+
description: "Make all properties in T optional"
|
|
302
|
+
},
|
|
303
|
+
SSH: {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
public_keys: {
|
|
307
|
+
type: "array",
|
|
308
|
+
items: {
|
|
309
|
+
type: "string"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
required: []
|
|
314
|
+
},
|
|
315
|
+
Meta: {
|
|
316
|
+
type: "object",
|
|
317
|
+
properties: {
|
|
318
|
+
trigger: {
|
|
319
|
+
type: "string"
|
|
320
|
+
},
|
|
321
|
+
system_resources: {
|
|
322
|
+
$ref: "#/components/schemas/Recordstringstringnumber"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
required: [],
|
|
326
|
+
additionalProperties: {
|
|
327
|
+
oneOf: [
|
|
328
|
+
{
|
|
329
|
+
type: "string"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
type: "number"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
type: "array",
|
|
336
|
+
items: {
|
|
337
|
+
oneOf: [
|
|
338
|
+
{
|
|
339
|
+
type: "string"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: "number"
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
$ref: "#/components/schemas/Recordstringstringnumber(stringnumber)"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
Recordstringstringnumber: {
|
|
354
|
+
type: "object",
|
|
355
|
+
properties: {},
|
|
356
|
+
required: [],
|
|
357
|
+
description: "Construct a type with a set of properties K of type T",
|
|
358
|
+
additionalProperties: {
|
|
359
|
+
oneOf: [
|
|
360
|
+
{
|
|
361
|
+
type: "string"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
type: "number"
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"Recordstringstringnumber(stringnumber)": {
|
|
370
|
+
type: "object",
|
|
371
|
+
properties: {},
|
|
372
|
+
required: [],
|
|
373
|
+
description: "Construct a type with a set of properties K of type T",
|
|
374
|
+
additionalProperties: {
|
|
375
|
+
oneOf: [
|
|
376
|
+
{
|
|
377
|
+
type: "string"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
type: "number"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
type: "array",
|
|
384
|
+
items: {
|
|
385
|
+
oneOf: [
|
|
386
|
+
{
|
|
387
|
+
type: "string"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
type: "number"
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
Global: {
|
|
399
|
+
type: "object",
|
|
400
|
+
properties: {
|
|
401
|
+
image: {
|
|
402
|
+
type: "string"
|
|
403
|
+
},
|
|
404
|
+
gpu: {
|
|
405
|
+
type: "boolean"
|
|
406
|
+
},
|
|
407
|
+
entrypoint: {
|
|
408
|
+
oneOf: [
|
|
409
|
+
{
|
|
410
|
+
type: "string"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
$ref: "#/components/schemas/CMDArray"
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
env: {
|
|
418
|
+
$ref: "#/components/schemas/Env"
|
|
419
|
+
},
|
|
420
|
+
work_dir: {
|
|
421
|
+
type: "string"
|
|
422
|
+
},
|
|
423
|
+
variables: {
|
|
424
|
+
$ref: "#/components/schemas/Variables"
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
required: []
|
|
428
|
+
},
|
|
429
|
+
CMDArray: {
|
|
430
|
+
type: "array",
|
|
431
|
+
items: {
|
|
432
|
+
type: "string"
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
Env: {
|
|
436
|
+
type: "object",
|
|
437
|
+
properties: {},
|
|
438
|
+
required: [],
|
|
439
|
+
additionalProperties: {
|
|
440
|
+
type: "string"
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
Variables: {
|
|
444
|
+
type: "object",
|
|
445
|
+
properties: {},
|
|
446
|
+
required: [],
|
|
447
|
+
additionalProperties: {
|
|
448
|
+
type: "string"
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
Ops: {
|
|
452
|
+
type: "array",
|
|
453
|
+
items: {
|
|
454
|
+
$ref: "#/components/schemas/OperationkeyofOperationArgsMap"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
OperationkeyofOperationArgsMap: {
|
|
458
|
+
type: "object",
|
|
459
|
+
properties: {
|
|
460
|
+
type: {
|
|
461
|
+
oneOf: [
|
|
462
|
+
{
|
|
463
|
+
"const": "container/run"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"const": "container/create-volume"
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
},
|
|
470
|
+
id: {
|
|
471
|
+
$ref: "#/components/schemas/OperationId"
|
|
472
|
+
},
|
|
473
|
+
args: {
|
|
474
|
+
oneOf: [
|
|
475
|
+
{
|
|
476
|
+
$ref: "#/components/schemas/ContainerRun"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
$ref: "#/components/schemas/ContainerCreateVolume"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
},
|
|
483
|
+
results: {
|
|
484
|
+
$ref: "#/components/schemas/OperationResults"
|
|
485
|
+
},
|
|
486
|
+
execution: {
|
|
487
|
+
$ref: "#/components/schemas/Execution"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
required: [
|
|
491
|
+
"type",
|
|
492
|
+
"id",
|
|
493
|
+
"args"
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
OperationId: {
|
|
497
|
+
type: "string"
|
|
498
|
+
},
|
|
499
|
+
ContainerRun: {
|
|
500
|
+
type: "object",
|
|
501
|
+
properties: {
|
|
502
|
+
image: {
|
|
503
|
+
type: "string"
|
|
504
|
+
},
|
|
505
|
+
aliases: {
|
|
506
|
+
oneOf: [
|
|
507
|
+
{
|
|
508
|
+
type: "string"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
$ref: "#/components/schemas/Aliases"
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
cmd: {
|
|
516
|
+
oneOf: [
|
|
517
|
+
{
|
|
518
|
+
type: "string"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
$ref: "#/components/schemas/CMDArray"
|
|
522
|
+
}
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
volumes: {
|
|
526
|
+
type: "array",
|
|
527
|
+
items: {
|
|
528
|
+
$ref: "#/components/schemas/Volume"
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
expose: {
|
|
532
|
+
oneOf: [
|
|
533
|
+
{
|
|
534
|
+
type: "number"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
$ref: "#/components/schemas/LiteralString"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
type: "object",
|
|
541
|
+
properties: {
|
|
542
|
+
__spread__: {
|
|
543
|
+
$ref: "#/components/schemas/LiteralString"
|
|
544
|
+
},
|
|
545
|
+
chunked: {
|
|
546
|
+
type: "boolean"
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
required: [
|
|
550
|
+
"__spread__"
|
|
551
|
+
]
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
$ref: "#/components/schemas/ExposedPort"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
$ref: "#/components/schemas/UniqueExposedPorts"
|
|
558
|
+
}
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
gpu: {
|
|
562
|
+
type: "boolean"
|
|
563
|
+
},
|
|
564
|
+
work_dir: {
|
|
565
|
+
type: "string"
|
|
566
|
+
},
|
|
567
|
+
entrypoint: {
|
|
568
|
+
oneOf: [
|
|
569
|
+
{
|
|
570
|
+
type: "string"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
$ref: "#/components/schemas/CMDArray"
|
|
574
|
+
}
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
env: {
|
|
578
|
+
$ref: "#/components/schemas/Env"
|
|
579
|
+
},
|
|
580
|
+
restart_policy: {
|
|
581
|
+
oneOf: [
|
|
582
|
+
{
|
|
583
|
+
"const": "on-failure"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"const": "no"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"const": "always"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"const": "unless-stopped"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
type: "object",
|
|
596
|
+
properties: {
|
|
597
|
+
policy: {
|
|
598
|
+
"const": "on-failure"
|
|
599
|
+
},
|
|
600
|
+
restart_tries: {
|
|
601
|
+
type: "number"
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
required: [
|
|
605
|
+
"policy"
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
]
|
|
609
|
+
},
|
|
610
|
+
"private": {
|
|
611
|
+
type: "boolean"
|
|
612
|
+
},
|
|
613
|
+
resources: {
|
|
614
|
+
$ref: "#/components/schemas/Resources"
|
|
615
|
+
},
|
|
616
|
+
authentication: {
|
|
617
|
+
$ref: "#/components/schemas/Authentication"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
required: [
|
|
621
|
+
"image"
|
|
622
|
+
]
|
|
623
|
+
},
|
|
624
|
+
Aliases: {
|
|
625
|
+
type: "array",
|
|
626
|
+
items: {
|
|
627
|
+
type: "string"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
Volume: {
|
|
631
|
+
type: "object",
|
|
632
|
+
properties: {
|
|
633
|
+
name: {
|
|
634
|
+
type: "string"
|
|
635
|
+
},
|
|
636
|
+
dest: {
|
|
637
|
+
type: "string"
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
required: [
|
|
641
|
+
"name",
|
|
642
|
+
"dest"
|
|
643
|
+
]
|
|
644
|
+
},
|
|
645
|
+
LiteralString: {
|
|
646
|
+
type: "string"
|
|
647
|
+
},
|
|
648
|
+
ExposedPort: {
|
|
649
|
+
type: "object",
|
|
650
|
+
properties: {
|
|
651
|
+
port: {
|
|
652
|
+
type: "number"
|
|
653
|
+
},
|
|
654
|
+
type: {
|
|
655
|
+
oneOf: [
|
|
656
|
+
{
|
|
657
|
+
"const": "api"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"const": "web"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"const": "websocket"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"const": "webapi"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"const": "none"
|
|
670
|
+
}
|
|
671
|
+
]
|
|
672
|
+
},
|
|
673
|
+
health_checks: {
|
|
674
|
+
type: "array",
|
|
675
|
+
items: {
|
|
676
|
+
$ref: "#/components/schemas/HealthCheck"
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
required: [
|
|
681
|
+
"port"
|
|
682
|
+
]
|
|
683
|
+
},
|
|
684
|
+
HealthCheck: {
|
|
685
|
+
oneOf: [
|
|
686
|
+
{
|
|
687
|
+
$ref: "#/components/schemas/HttpHealthCheck"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
$ref: "#/components/schemas/WebSocketHealthCheck"
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
},
|
|
694
|
+
HttpHealthCheck: {
|
|
695
|
+
type: "object",
|
|
696
|
+
properties: {
|
|
697
|
+
type: {
|
|
698
|
+
"const": "http"
|
|
699
|
+
},
|
|
700
|
+
path: {
|
|
701
|
+
type: "string"
|
|
702
|
+
},
|
|
703
|
+
method: {
|
|
704
|
+
oneOf: [
|
|
705
|
+
{
|
|
706
|
+
"const": "GET"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"const": "POST"
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"const": "PUT"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"const": "DELETE"
|
|
716
|
+
}
|
|
717
|
+
]
|
|
718
|
+
},
|
|
719
|
+
expected_status: {
|
|
720
|
+
type: "number"
|
|
721
|
+
},
|
|
722
|
+
headers: {
|
|
723
|
+
$ref: "#/components/schemas/Recordstringstring"
|
|
724
|
+
},
|
|
725
|
+
body: {},
|
|
726
|
+
continuous: {
|
|
727
|
+
type: "boolean"
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
required: [
|
|
731
|
+
"type",
|
|
732
|
+
"path",
|
|
733
|
+
"method",
|
|
734
|
+
"expected_status",
|
|
735
|
+
"continuous"
|
|
736
|
+
]
|
|
737
|
+
},
|
|
738
|
+
Recordstringstring: {
|
|
739
|
+
type: "object",
|
|
740
|
+
properties: {},
|
|
741
|
+
required: [],
|
|
742
|
+
description: "Construct a type with a set of properties K of type T",
|
|
743
|
+
additionalProperties: {
|
|
744
|
+
type: "string"
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
WebSocketHealthCheck: {
|
|
748
|
+
type: "object",
|
|
749
|
+
properties: {
|
|
750
|
+
type: {
|
|
751
|
+
"const": "websocket"
|
|
752
|
+
},
|
|
753
|
+
expected_response: {
|
|
754
|
+
type: "string"
|
|
755
|
+
},
|
|
756
|
+
continuous: {
|
|
757
|
+
type: "boolean"
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
required: [
|
|
761
|
+
"type",
|
|
762
|
+
"expected_response",
|
|
763
|
+
"continuous"
|
|
764
|
+
]
|
|
765
|
+
},
|
|
766
|
+
UniqueExposedPorts: {
|
|
767
|
+
type: "array",
|
|
768
|
+
items: {
|
|
769
|
+
$ref: "#/components/schemas/ExposeBase"
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
ExposeBase: {
|
|
773
|
+
oneOf: [
|
|
774
|
+
{
|
|
775
|
+
type: "number"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
$ref: "#/components/schemas/LiteralString"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
type: "object",
|
|
782
|
+
properties: {
|
|
783
|
+
__spread__: {
|
|
784
|
+
$ref: "#/components/schemas/LiteralString"
|
|
785
|
+
},
|
|
786
|
+
chunked: {
|
|
787
|
+
type: "boolean"
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
required: [
|
|
791
|
+
"__spread__"
|
|
792
|
+
]
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
$ref: "#/components/schemas/ExposedPort"
|
|
796
|
+
}
|
|
797
|
+
]
|
|
798
|
+
},
|
|
799
|
+
Resources: {
|
|
800
|
+
type: "array",
|
|
801
|
+
items: {
|
|
802
|
+
oneOf: [
|
|
803
|
+
{
|
|
804
|
+
"const": "__remove-if-empty__"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
type: "object",
|
|
808
|
+
properties: {
|
|
809
|
+
__spread__: {
|
|
810
|
+
$ref: "#/components/schemas/LiteralString"
|
|
811
|
+
},
|
|
812
|
+
chunked: {
|
|
813
|
+
type: "boolean"
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
required: [
|
|
817
|
+
"__spread__"
|
|
818
|
+
]
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
$ref: "#/components/schemas/S3Base"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
$ref: "#/components/schemas/S3WithBucket"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
$ref: "#/components/schemas/S3WithBuckets"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
$ref: "#/components/schemas/HFResource"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
$ref: "#/components/schemas/OllamaResource"
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
S3Base: {
|
|
839
|
+
type: "object",
|
|
840
|
+
properties: {
|
|
841
|
+
type: {
|
|
842
|
+
"const": "S3"
|
|
843
|
+
},
|
|
844
|
+
target: {
|
|
845
|
+
type: "string"
|
|
846
|
+
},
|
|
847
|
+
url: {
|
|
848
|
+
type: "string"
|
|
849
|
+
},
|
|
850
|
+
allowWrite: {
|
|
851
|
+
type: "boolean"
|
|
852
|
+
},
|
|
853
|
+
files: {
|
|
854
|
+
type: "array",
|
|
855
|
+
items: {
|
|
856
|
+
type: "string"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
IAM: {
|
|
860
|
+
$ref: "#/components/schemas/S3Auth"
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
required: [
|
|
864
|
+
"type",
|
|
865
|
+
"target"
|
|
866
|
+
]
|
|
867
|
+
},
|
|
868
|
+
S3Auth: {
|
|
869
|
+
type: "object",
|
|
870
|
+
properties: {
|
|
871
|
+
REGION: {
|
|
872
|
+
type: "string"
|
|
873
|
+
},
|
|
874
|
+
ACCESS_KEY_ID: {
|
|
875
|
+
type: "string"
|
|
876
|
+
},
|
|
877
|
+
SECRET_ACCESS_KEY: {
|
|
878
|
+
type: "string"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
required: [
|
|
882
|
+
"REGION",
|
|
883
|
+
"ACCESS_KEY_ID",
|
|
884
|
+
"SECRET_ACCESS_KEY"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
S3WithBucket: {
|
|
888
|
+
type: "object",
|
|
889
|
+
properties: {
|
|
890
|
+
type: {
|
|
891
|
+
"const": "S3"
|
|
892
|
+
},
|
|
893
|
+
target: {
|
|
894
|
+
type: "string"
|
|
895
|
+
},
|
|
896
|
+
bucket: {
|
|
897
|
+
type: "string"
|
|
898
|
+
},
|
|
899
|
+
url: {
|
|
900
|
+
type: "string"
|
|
901
|
+
},
|
|
902
|
+
allowWrite: {
|
|
903
|
+
type: "boolean"
|
|
904
|
+
},
|
|
905
|
+
IAM: {
|
|
906
|
+
$ref: "#/components/schemas/S3Auth"
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
required: [
|
|
910
|
+
"type",
|
|
911
|
+
"target",
|
|
912
|
+
"bucket"
|
|
913
|
+
]
|
|
914
|
+
},
|
|
915
|
+
S3WithBuckets: {
|
|
916
|
+
type: "object",
|
|
917
|
+
properties: {
|
|
918
|
+
type: {
|
|
919
|
+
"const": "S3"
|
|
920
|
+
},
|
|
921
|
+
target: {
|
|
922
|
+
type: "string"
|
|
923
|
+
},
|
|
924
|
+
buckets: {
|
|
925
|
+
type: "array",
|
|
926
|
+
items: {
|
|
927
|
+
type: "object",
|
|
928
|
+
properties: {
|
|
929
|
+
url: {
|
|
930
|
+
type: "string"
|
|
931
|
+
},
|
|
932
|
+
files: {
|
|
933
|
+
type: "array",
|
|
934
|
+
items: {
|
|
935
|
+
type: "string"
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
required: [
|
|
940
|
+
"url"
|
|
941
|
+
]
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
url: {
|
|
945
|
+
type: "string"
|
|
946
|
+
},
|
|
947
|
+
allowWrite: {
|
|
948
|
+
type: "boolean"
|
|
949
|
+
},
|
|
950
|
+
IAM: {
|
|
951
|
+
$ref: "#/components/schemas/S3Auth"
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
required: [
|
|
955
|
+
"type",
|
|
956
|
+
"target",
|
|
957
|
+
"buckets"
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
HFResource: {
|
|
961
|
+
type: "object",
|
|
962
|
+
properties: {
|
|
963
|
+
type: {
|
|
964
|
+
"const": "HF"
|
|
965
|
+
},
|
|
966
|
+
target: {
|
|
967
|
+
type: "string"
|
|
968
|
+
},
|
|
969
|
+
repo: {
|
|
970
|
+
type: "string"
|
|
971
|
+
},
|
|
972
|
+
revision: {
|
|
973
|
+
type: "string"
|
|
974
|
+
},
|
|
975
|
+
files: {
|
|
976
|
+
type: "array",
|
|
977
|
+
items: {
|
|
978
|
+
type: "string"
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
accessToken: {
|
|
982
|
+
type: "string"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
required: [
|
|
986
|
+
"type",
|
|
987
|
+
"target",
|
|
988
|
+
"repo"
|
|
989
|
+
]
|
|
990
|
+
},
|
|
991
|
+
OllamaResource: {
|
|
992
|
+
type: "object",
|
|
993
|
+
properties: {
|
|
994
|
+
type: {
|
|
995
|
+
"const": "Ollama"
|
|
996
|
+
},
|
|
997
|
+
model: {
|
|
998
|
+
type: "string"
|
|
999
|
+
},
|
|
1000
|
+
target: {
|
|
1001
|
+
type: "string"
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
required: [
|
|
1005
|
+
"type",
|
|
1006
|
+
"model"
|
|
1007
|
+
]
|
|
1008
|
+
},
|
|
1009
|
+
Authentication: {
|
|
1010
|
+
type: "object",
|
|
1011
|
+
properties: {
|
|
1012
|
+
docker: {
|
|
1013
|
+
$ref: "#/components/schemas/DockerAuth"
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
required: []
|
|
1017
|
+
},
|
|
1018
|
+
DockerAuth: {
|
|
1019
|
+
type: "object",
|
|
1020
|
+
properties: {
|
|
1021
|
+
username: {
|
|
1022
|
+
type: "string"
|
|
1023
|
+
},
|
|
1024
|
+
password: {
|
|
1025
|
+
type: "string"
|
|
1026
|
+
},
|
|
1027
|
+
email: {
|
|
1028
|
+
type: "string"
|
|
1029
|
+
},
|
|
1030
|
+
server: {
|
|
1031
|
+
type: "string"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
required: []
|
|
1035
|
+
},
|
|
1036
|
+
ContainerCreateVolume: {
|
|
1037
|
+
type: "object",
|
|
1038
|
+
properties: {
|
|
1039
|
+
name: {
|
|
1040
|
+
type: "string"
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
required: [
|
|
1044
|
+
"name"
|
|
1045
|
+
]
|
|
1046
|
+
},
|
|
1047
|
+
OperationResults: {
|
|
1048
|
+
type: "object",
|
|
1049
|
+
properties: {},
|
|
1050
|
+
required: [],
|
|
1051
|
+
additionalProperties: {
|
|
1052
|
+
oneOf: [
|
|
1053
|
+
{
|
|
1054
|
+
type: "string"
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
$ref: "#/components/schemas/OperationResult"
|
|
1058
|
+
}
|
|
1059
|
+
]
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
OperationResult: {
|
|
1063
|
+
type: "object",
|
|
1064
|
+
properties: {
|
|
1065
|
+
regex: {
|
|
1066
|
+
type: "string"
|
|
1067
|
+
},
|
|
1068
|
+
logType: {
|
|
1069
|
+
$ref: "#/components/schemas/LogTypeTuple"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
required: [
|
|
1073
|
+
"regex",
|
|
1074
|
+
"logType"
|
|
1075
|
+
]
|
|
1076
|
+
},
|
|
1077
|
+
LogTypeTuple: {
|
|
1078
|
+
type: "array",
|
|
1079
|
+
items: {
|
|
1080
|
+
$ref: "#/components/schemas/StdOption"
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
StdOption: {
|
|
1084
|
+
oneOf: [
|
|
1085
|
+
{
|
|
1086
|
+
"const": "stdin"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"const": "stdout"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"const": "stderr"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"const": "nodeerr"
|
|
1096
|
+
}
|
|
1097
|
+
]
|
|
1098
|
+
},
|
|
1099
|
+
Execution: {
|
|
1100
|
+
type: "object",
|
|
1101
|
+
properties: {
|
|
1102
|
+
group: {
|
|
1103
|
+
type: "string"
|
|
1104
|
+
},
|
|
1105
|
+
timeout: {
|
|
1106
|
+
type: "number"
|
|
1107
|
+
},
|
|
1108
|
+
depends_on: {
|
|
1109
|
+
type: "array",
|
|
1110
|
+
items: {
|
|
1111
|
+
type: "string"
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
stop_if_dependent_stops: {
|
|
1115
|
+
type: "boolean"
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
required: []
|
|
1119
|
+
},
|
|
1120
|
+
FlowState: {
|
|
1121
|
+
type: "object",
|
|
1122
|
+
properties: {
|
|
1123
|
+
status: {
|
|
1124
|
+
type: "string"
|
|
1125
|
+
},
|
|
1126
|
+
startTime: {
|
|
1127
|
+
type: "number"
|
|
1128
|
+
},
|
|
1129
|
+
endTime: {
|
|
1130
|
+
oneOf: [
|
|
1131
|
+
{
|
|
1132
|
+
type: "null"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
type: "number"
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
errors: {
|
|
1140
|
+
type: "array",
|
|
1141
|
+
items: {}
|
|
1142
|
+
},
|
|
1143
|
+
opStates: {
|
|
1144
|
+
type: "array",
|
|
1145
|
+
items: {
|
|
1146
|
+
$ref: "#/components/schemas/OpState"
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
secrets: {
|
|
1150
|
+
$ref: "#/components/schemas/FlowSecrets"
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
required: [
|
|
1154
|
+
"status",
|
|
1155
|
+
"startTime",
|
|
1156
|
+
"endTime",
|
|
1157
|
+
"opStates"
|
|
1158
|
+
]
|
|
1159
|
+
},
|
|
1160
|
+
OpState: {
|
|
1161
|
+
type: "object",
|
|
1162
|
+
properties: {
|
|
1163
|
+
providerId: {
|
|
1164
|
+
oneOf: [
|
|
1165
|
+
{
|
|
1166
|
+
type: "null"
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
type: "string"
|
|
1170
|
+
}
|
|
1171
|
+
]
|
|
1172
|
+
},
|
|
1173
|
+
operationId: {
|
|
1174
|
+
oneOf: [
|
|
1175
|
+
{
|
|
1176
|
+
type: "null"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
type: "string"
|
|
1180
|
+
}
|
|
1181
|
+
]
|
|
1182
|
+
},
|
|
1183
|
+
group: {
|
|
1184
|
+
oneOf: [
|
|
1185
|
+
{
|
|
1186
|
+
type: "null"
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
type: "string"
|
|
1190
|
+
}
|
|
1191
|
+
]
|
|
1192
|
+
},
|
|
1193
|
+
status: {
|
|
1194
|
+
oneOf: [
|
|
1195
|
+
{
|
|
1196
|
+
type: "null"
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
type: "string"
|
|
1200
|
+
}
|
|
1201
|
+
]
|
|
1202
|
+
},
|
|
1203
|
+
startTime: {
|
|
1204
|
+
oneOf: [
|
|
1205
|
+
{
|
|
1206
|
+
type: "null"
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
type: "number"
|
|
1210
|
+
}
|
|
1211
|
+
]
|
|
1212
|
+
},
|
|
1213
|
+
endTime: {
|
|
1214
|
+
oneOf: [
|
|
1215
|
+
{
|
|
1216
|
+
type: "null"
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
type: "number"
|
|
1220
|
+
}
|
|
1221
|
+
]
|
|
1222
|
+
},
|
|
1223
|
+
exitCode: {
|
|
1224
|
+
oneOf: [
|
|
1225
|
+
{
|
|
1226
|
+
type: "null"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
type: "number"
|
|
1230
|
+
}
|
|
1231
|
+
]
|
|
1232
|
+
},
|
|
1233
|
+
logs: {
|
|
1234
|
+
type: "array",
|
|
1235
|
+
items: {
|
|
1236
|
+
$ref: "#/components/schemas/Log"
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
results: {
|
|
1240
|
+
type: "object",
|
|
1241
|
+
properties: {},
|
|
1242
|
+
required: [],
|
|
1243
|
+
additionalProperties: {
|
|
1244
|
+
oneOf: [
|
|
1245
|
+
{
|
|
1246
|
+
type: "string"
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
type: "array",
|
|
1250
|
+
items: {
|
|
1251
|
+
type: "string"
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
]
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
error: {
|
|
1258
|
+
type: "object",
|
|
1259
|
+
properties: {
|
|
1260
|
+
event: {
|
|
1261
|
+
type: "string"
|
|
1262
|
+
},
|
|
1263
|
+
message: {
|
|
1264
|
+
type: "string"
|
|
1265
|
+
},
|
|
1266
|
+
code: {
|
|
1267
|
+
type: "number"
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
required: [
|
|
1271
|
+
"event",
|
|
1272
|
+
"message"
|
|
1273
|
+
]
|
|
1274
|
+
},
|
|
1275
|
+
diagnostics: {
|
|
1276
|
+
type: "object",
|
|
1277
|
+
properties: {
|
|
1278
|
+
reason: {
|
|
1279
|
+
$ref: "#/components/schemas/DiagnosticsReason"
|
|
1280
|
+
},
|
|
1281
|
+
state: {
|
|
1282
|
+
$ref: "#/components/schemas/DiagnosticsState"
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
required: [
|
|
1286
|
+
"reason"
|
|
1287
|
+
]
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
required: [
|
|
1291
|
+
"providerId",
|
|
1292
|
+
"operationId",
|
|
1293
|
+
"group",
|
|
1294
|
+
"status",
|
|
1295
|
+
"startTime",
|
|
1296
|
+
"endTime",
|
|
1297
|
+
"exitCode",
|
|
1298
|
+
"logs",
|
|
1299
|
+
"diagnostics"
|
|
1300
|
+
]
|
|
1301
|
+
},
|
|
1302
|
+
Log: {
|
|
1303
|
+
type: "object",
|
|
1304
|
+
properties: {
|
|
1305
|
+
type: {
|
|
1306
|
+
$ref: "#/components/schemas/StdOption"
|
|
1307
|
+
},
|
|
1308
|
+
log: {
|
|
1309
|
+
type: "string"
|
|
1310
|
+
},
|
|
1311
|
+
timestamp: {
|
|
1312
|
+
type: "string"
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
required: [
|
|
1316
|
+
"type",
|
|
1317
|
+
"timestamp"
|
|
1318
|
+
]
|
|
1319
|
+
},
|
|
1320
|
+
DiagnosticsReason: {
|
|
1321
|
+
type: "object",
|
|
1322
|
+
properties: {
|
|
1323
|
+
hostShutDown: {
|
|
1324
|
+
type: "boolean"
|
|
1325
|
+
},
|
|
1326
|
+
jobStopped: {
|
|
1327
|
+
type: "boolean"
|
|
1328
|
+
},
|
|
1329
|
+
jobExpired: {
|
|
1330
|
+
type: "boolean"
|
|
1331
|
+
},
|
|
1332
|
+
reason: {
|
|
1333
|
+
type: "string"
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
required: [
|
|
1337
|
+
"hostShutDown",
|
|
1338
|
+
"jobStopped",
|
|
1339
|
+
"jobExpired"
|
|
1340
|
+
]
|
|
1341
|
+
},
|
|
1342
|
+
DiagnosticsState: {
|
|
1343
|
+
type: "object",
|
|
1344
|
+
properties: {
|
|
1345
|
+
Status: {
|
|
1346
|
+
type: "string"
|
|
1347
|
+
},
|
|
1348
|
+
Running: {
|
|
1349
|
+
type: "boolean"
|
|
1350
|
+
},
|
|
1351
|
+
Paused: {
|
|
1352
|
+
type: "boolean"
|
|
1353
|
+
},
|
|
1354
|
+
Restarting: {
|
|
1355
|
+
type: "boolean"
|
|
1356
|
+
},
|
|
1357
|
+
OOMKilled: {
|
|
1358
|
+
type: "boolean"
|
|
1359
|
+
},
|
|
1360
|
+
Dead: {
|
|
1361
|
+
type: "boolean"
|
|
1362
|
+
},
|
|
1363
|
+
Pid: {
|
|
1364
|
+
type: "number"
|
|
1365
|
+
},
|
|
1366
|
+
ExitCode: {
|
|
1367
|
+
type: "number"
|
|
1368
|
+
},
|
|
1369
|
+
Error: {
|
|
1370
|
+
type: "string"
|
|
1371
|
+
},
|
|
1372
|
+
StartedAt: {
|
|
1373
|
+
type: "string"
|
|
1374
|
+
},
|
|
1375
|
+
FinishedAt: {
|
|
1376
|
+
type: "string"
|
|
1377
|
+
},
|
|
1378
|
+
Health: {
|
|
1379
|
+
type: "object",
|
|
1380
|
+
properties: {
|
|
1381
|
+
Status: {
|
|
1382
|
+
type: "string"
|
|
1383
|
+
},
|
|
1384
|
+
FailingStreak: {
|
|
1385
|
+
type: "number"
|
|
1386
|
+
},
|
|
1387
|
+
Log: {
|
|
1388
|
+
oneOf: [
|
|
1389
|
+
{
|
|
1390
|
+
type: "null"
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
type: "array",
|
|
1394
|
+
items: {
|
|
1395
|
+
type: "object",
|
|
1396
|
+
properties: {
|
|
1397
|
+
Start: {
|
|
1398
|
+
type: "string"
|
|
1399
|
+
},
|
|
1400
|
+
End: {
|
|
1401
|
+
type: "string"
|
|
1402
|
+
},
|
|
1403
|
+
ExitCode: {
|
|
1404
|
+
type: "number"
|
|
1405
|
+
},
|
|
1406
|
+
Output: {
|
|
1407
|
+
type: "string"
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
required: [
|
|
1411
|
+
"Start",
|
|
1412
|
+
"End",
|
|
1413
|
+
"ExitCode",
|
|
1414
|
+
"Output"
|
|
1415
|
+
]
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
]
|
|
1419
|
+
}
|
|
1420
|
+
},
|
|
1421
|
+
required: [
|
|
1422
|
+
"Status",
|
|
1423
|
+
"FailingStreak",
|
|
1424
|
+
"Log"
|
|
1425
|
+
]
|
|
1426
|
+
},
|
|
1427
|
+
RestartCount: {
|
|
1428
|
+
type: "number"
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
required: [
|
|
1432
|
+
"Status",
|
|
1433
|
+
"Running",
|
|
1434
|
+
"Paused",
|
|
1435
|
+
"Restarting",
|
|
1436
|
+
"OOMKilled",
|
|
1437
|
+
"Dead",
|
|
1438
|
+
"Pid",
|
|
1439
|
+
"ExitCode",
|
|
1440
|
+
"Error",
|
|
1441
|
+
"StartedAt",
|
|
1442
|
+
"FinishedAt",
|
|
1443
|
+
"RestartCount"
|
|
1444
|
+
]
|
|
1445
|
+
},
|
|
1446
|
+
FlowSecrets: {
|
|
1447
|
+
type: "object",
|
|
1448
|
+
properties: {
|
|
1449
|
+
urlmode: {
|
|
1450
|
+
oneOf: [
|
|
1451
|
+
{
|
|
1452
|
+
"const": "private"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
"const": "public"
|
|
1456
|
+
}
|
|
1457
|
+
]
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
required: [],
|
|
1461
|
+
additionalProperties: {
|
|
1462
|
+
oneOf: [
|
|
1463
|
+
{
|
|
1464
|
+
"const": "private"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"const": "public"
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
$ref: "#/components/schemas/JobExposeSecrets"
|
|
1471
|
+
}
|
|
1472
|
+
]
|
|
1473
|
+
}
|
|
1474
|
+
},
|
|
1475
|
+
JobExposeSecrets: {
|
|
1476
|
+
type: "object",
|
|
1477
|
+
properties: {},
|
|
1478
|
+
required: [],
|
|
1479
|
+
additionalProperties: {
|
|
1480
|
+
$ref: "#/components/schemas/EndpointSecret"
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
EndpointSecret: {
|
|
1484
|
+
type: "object",
|
|
1485
|
+
properties: {
|
|
1486
|
+
opID: {
|
|
1487
|
+
type: "string"
|
|
1488
|
+
},
|
|
1489
|
+
port: {
|
|
1490
|
+
oneOf: [
|
|
1491
|
+
{
|
|
1492
|
+
type: "string"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
type: "number"
|
|
1496
|
+
}
|
|
1497
|
+
]
|
|
1498
|
+
},
|
|
1499
|
+
url: {
|
|
1500
|
+
type: "string"
|
|
1501
|
+
},
|
|
1502
|
+
status: {
|
|
1503
|
+
$ref: "#/components/schemas/EndpointStatus"
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
required: [
|
|
1507
|
+
"opID",
|
|
1508
|
+
"port",
|
|
1509
|
+
"url",
|
|
1510
|
+
"status"
|
|
1511
|
+
]
|
|
1512
|
+
},
|
|
1513
|
+
EndpointStatus: {
|
|
1514
|
+
oneOf: [
|
|
1515
|
+
{
|
|
1516
|
+
"const": "ONLINE"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"const": "OFFLINE"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
"const": "UNKNOWN"
|
|
1523
|
+
}
|
|
1524
|
+
]
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
},
|
|
1528
|
+
schemas: [
|
|
1529
|
+
{
|
|
1530
|
+
$ref: "#/components/schemas/JobDefinition"
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
$ref: "#/components/schemas/FlowState"
|
|
1534
|
+
}
|
|
1535
|
+
]
|
|
1536
|
+
};
|
|
1537
|
+
return {
|
|
1538
|
+
openapi: "3.1.0",
|
|
1539
|
+
info: {
|
|
1540
|
+
title: "Nosana Node API",
|
|
1541
|
+
version: "1.0.0",
|
|
1542
|
+
description: "The HTTP API every Nosana node serves on its own host for the jobs it runs. Job routes are authorized with the standard Nosana authorization header signed by the job's owner; nodes never accept API keys. The node also multiplexes WebSocket routes over one socket, described under `x-websocket`.",
|
|
1543
|
+
},
|
|
1544
|
+
servers: [
|
|
1545
|
+
{
|
|
1546
|
+
url: "https://{node}.{domain}",
|
|
1547
|
+
description: "One node, addressed by its Solana address.",
|
|
1548
|
+
variables: {
|
|
1549
|
+
node: { default: "NODE_ADDRESS", description: "The node's address." },
|
|
1550
|
+
domain: { default: "node.k8s.prd.nos.ci", enum: ["node.k8s.prd.nos.ci", "node.k8s.dev.nos.ci"], description: "Mainnet or devnet nodes." },
|
|
1551
|
+
},
|
|
1552
|
+
},
|
|
1553
|
+
],
|
|
1554
|
+
tags: [
|
|
1555
|
+
{ name: "Node", description: "About the node itself. Public." },
|
|
1556
|
+
{ name: "Job", description: "A job the node runs, as the node sees it." },
|
|
1557
|
+
{ name: "SSH", description: "Which SSH keys may reach a job." },
|
|
1558
|
+
],
|
|
1559
|
+
paths: {
|
|
1560
|
+
"/": { get: operation("getNodeAddress", "Node", "The node's address", "Answers with the node's own address, as a liveness check.", { "200": text("The node's address.") }, { public: true }) },
|
|
1561
|
+
"/node/info": {
|
|
1562
|
+
get: operation("getNodeInfo", "Node", "Node info", "What the node is, what it runs on and which images and volumes it holds. Public.", { "200": json("The node's info.", ref("NodeInfo")) }, { public: true }),
|
|
1563
|
+
},
|
|
1564
|
+
"/job/{job}/info": {
|
|
1565
|
+
get: operation("streamJobInfo", "Job", "Stream job info", "Server-sent events: the job's flow without logs plus its task status, sent on open and whenever it changes, until the job ends.", { "200": sse("A stream of `JobInfo` frames as unnamed `message` events."), "401": UNAUTHORIZED, "404": NOT_FOUND }, { params: [job] }),
|
|
1566
|
+
},
|
|
1567
|
+
"/job/{job}/job-definition": {
|
|
1568
|
+
get: operation("getJobDefinition", "Job", "Get the job definition", "The job definition. Fails while the job still waits for one. The node labels the body as text, but it is JSON.", { "200": json("The job definition.", ref("JobDefinition")), ...jobErrors }, { params: [job] }),
|
|
1569
|
+
post: operation("setJobDefinition", "Job", "Send the job definition", "Accepted only while the job waits for its definition.", { "200": text("Acknowledged."), ...jobErrors }, { params: [job], body: ref("JobDefinition") }),
|
|
1570
|
+
},
|
|
1571
|
+
"/job/{job}/results": {
|
|
1572
|
+
get: operation("getJobResults", "Job", "Collect the job results", "The finished flow state. Available once the job waits for its result to be collected; collecting it lets the node finish the job. The node labels the body as text, but it is JSON.", { "200": json("The flow state.", ref("FlowState")), ...jobErrors }, { params: [job] }),
|
|
1573
|
+
},
|
|
1574
|
+
"/job/{job}/ops": { get: operation("getJobOperations", "Job", "Operation statuses", "Status of every operation of the job.", { "200": json("Statuses by operation id.", ref("OperationStatuses")), ...jobErrors }, { params: [job] }) },
|
|
1575
|
+
"/job/{job}/ops/{op}": {
|
|
1576
|
+
get: operation("getJobOperation", "Job", "Operation status", "Status of one operation.", { "200": json("The operation's status.", { type: "string" }), ...jobErrors, "404": NOT_FOUND }, { params: [job, op] }),
|
|
1577
|
+
},
|
|
1578
|
+
"/job/{job}/group/current": {
|
|
1579
|
+
get: operation("getJobCurrentGroup", "Job", "Current group statuses", "Status of the operations in the group currently running.", { "200": json("Statuses by operation id.", ref("OperationStatuses")), ...jobErrors }, { params: [job] }),
|
|
1580
|
+
},
|
|
1581
|
+
"/job/{job}/group/{group}": {
|
|
1582
|
+
get: operation("getJobGroup", "Job", "Group statuses", "Status of the operations in one group.", { "200": json("Statuses by operation id.", ref("OperationStatuses")), ...jobErrors, "404": NOT_FOUND }, { params: [job, group] }),
|
|
1583
|
+
},
|
|
1584
|
+
"/job/{job}/group/{group}/restart": {
|
|
1585
|
+
post: operation("restartJobGroup", "Job", "Restart a group", "Restarts every operation of the group.", { "202": json("Restart initiated.", ref("ActionResult")), ...jobErrors, "500": err("The restart failed.") }, { params: [job, group] }),
|
|
1586
|
+
},
|
|
1587
|
+
"/job/{job}/group/{group}/stop": {
|
|
1588
|
+
post: operation("stopJobGroup", "Job", "Stop a group", "Stops every operation of the group.", { "200": json("Stopped.", ref("ActionResult")), ...jobErrors, "500": err("The stop failed.") }, { params: [job, group] }),
|
|
1589
|
+
},
|
|
1590
|
+
"/job/{job}/group/{group}/operation/{op}/restart": {
|
|
1591
|
+
post: operation("restartJobOperation", "Job", "Restart an operation", "Restarts one operation of a group.", { "202": json("Restart initiated.", ref("ActionResult")), ...jobErrors, "500": err("The restart failed.") }, { params: [job, group, op] }),
|
|
1592
|
+
},
|
|
1593
|
+
"/job/{job}/group/{group}/operation/{op}/stop": {
|
|
1594
|
+
post: operation("stopJobOperation", "Job", "Stop an operation", "Stops one operation of a group.", { "200": json("Stopped.", ref("ActionResult")), ...jobErrors, "500": err("The stop failed.") }, { params: [job, group, op] }),
|
|
1595
|
+
},
|
|
1596
|
+
"/job/{job}/endpoints": {
|
|
1597
|
+
get: operation("getJobEndpoints", "Job", "Exposed endpoints", "The URLs the job exposes and whether they answer yet.", { "200": json("Endpoints and their status.", ref("JobEndpoints")), "400": err("The job exposes no endpoint."), "401": UNAUTHORIZED, "500": err("The node could not read the endpoints.") }, { params: [job] }),
|
|
1598
|
+
},
|
|
1599
|
+
"/job/{job}/stats": {
|
|
1600
|
+
get: operation("getJobStats", "Job", "Resource stats", "CPU, memory, disk and network samples per operation within a time window.", { "200": json("Samples, oldest first.", { type: "array", items: ref("TaskStat") }), "400": err("`start` and `end` must be timestamps in milliseconds."), "401": UNAUTHORIZED, "404": NOT_FOUND }, { params: [job, interval, millis("start", "Start of the window, Unix milliseconds."), millis("end", "End of the window, Unix milliseconds.")] }),
|
|
1601
|
+
},
|
|
1602
|
+
"/job/{job}/stats/stream": {
|
|
1603
|
+
get: operation("streamJobStats", "Job", "Stream resource stats", "Server-sent events: the latest sample per operation, every `interval` seconds, until the job ends.", { "200": sse("A stream of `TaskStat[]` frames as unnamed `message` events."), "401": UNAUTHORIZED, "404": NOT_FOUND }, { params: [job, interval] }),
|
|
1604
|
+
},
|
|
1605
|
+
"/job/{job}/stop": { post: operation("stopJob", "Job", "Stop the job", "Asks the node to stop the job.", { "200": text("Stopped."), ...jobErrors, "500": err("The stop failed.") }, { params: [job] }) },
|
|
1606
|
+
"/job/{job}/ssh/authorize": {
|
|
1607
|
+
post: operation("authorizeJobSshKey", "SSH", "Grant an SSH key", "Lets the key reach the job, permanently or until `expiresAt`. The signature must be the job owner's.", {
|
|
1608
|
+
"201": json("The key is authorized.", ref("SshAuthorization")),
|
|
1609
|
+
"400": err("The key is not a valid OpenSSH public key, or the expiry is invalid."),
|
|
1610
|
+
"401": UNAUTHORIZED,
|
|
1611
|
+
"404": NO_SSH_JOB,
|
|
1612
|
+
"502": NOT_APPLIED,
|
|
1613
|
+
"503": err("The SSH provider is not available."),
|
|
1614
|
+
}, { params: [job], body: ref("SshAuthorizationRequest") }),
|
|
1615
|
+
},
|
|
1616
|
+
"/job/{job}/ssh/keys": {
|
|
1617
|
+
get: operation("getJobSshKeys", "SSH", "List SSH keys", "The keys currently allowed to reach the job, with their expiry when temporary.", { "200": json("The job's keys.", ref("SshKeys")), "401": UNAUTHORIZED, "404": NO_SSH_JOB, "502": err("The node could not read its keys.") }, { params: [job] }),
|
|
1618
|
+
delete: operation("revokeJobSshKey", "SSH", "Revoke an SSH key", "Removes the key whatever its expiry. Open sessions stay until they disconnect.", { "200": json("The key is revoked.", ref("SshRevocation")), "400": err("The key is not a valid OpenSSH public key."), "401": UNAUTHORIZED, "404": NO_SSH_JOB, "502": NOT_APPLIED }, { params: [job], body: ref("SshRevocationRequest") }),
|
|
1619
|
+
},
|
|
1620
|
+
},
|
|
1621
|
+
components: {
|
|
1622
|
+
schemas: { ...withSafeNames(jobSchemas.components.schemas), ...ownSchemas },
|
|
1623
|
+
securitySchemes: {
|
|
1624
|
+
NosanaAuthorization: {
|
|
1625
|
+
type: "apiKey",
|
|
1626
|
+
in: "header",
|
|
1627
|
+
name: "authorization",
|
|
1628
|
+
description: "`message:base58-signature[:timestamp]` as produced by `@nosana/authorization`, signed by the wallet that owns the job. Any message is accepted; a timestamp, when present, must be within the job's timeout.",
|
|
1629
|
+
},
|
|
1630
|
+
},
|
|
1631
|
+
},
|
|
1632
|
+
"x-websocket": {
|
|
1633
|
+
description: "One WebSocket endpoint at the node's origin. The first frame is a JSON handshake `{ path, header, body }` where `header` is the same authorization string the HTTP routes take and `body` names the job; every later frame is `{ path, data }`. Only the terminal takes over the socket for raw frames.",
|
|
1634
|
+
routes: {
|
|
1635
|
+
"/log": { body: { jobAddress: "Address" }, frames: { path: "log", data: "a log message" }, description: "Node and container logs for basic job posters." },
|
|
1636
|
+
"/flog": {
|
|
1637
|
+
body: { jobAddress: "Address", "group?": "string", "opId?": "string", "type?": "string" },
|
|
1638
|
+
frames: { path: "flog", data: "TaskLog, JSON-encoded" },
|
|
1639
|
+
description: "Task manager logs: history first, then live.",
|
|
1640
|
+
},
|
|
1641
|
+
"/status": { body: { jobAddress: "Address" }, frames: { path: "state", data: "a state message" }, description: "State updates for the job. The node's own signature is accepted as well as the owner's." },
|
|
1642
|
+
"/terminal": {
|
|
1643
|
+
body: { jobAddress: "Address", message: "the signed grant text", signature: "base64 of the raw 64-byte signature", "op?": "string", "cols?": "integer", "rows?": "integer" },
|
|
1644
|
+
frames: {
|
|
1645
|
+
client: [{ type: "stdin", data: "string" }, { type: "resize", cols: "integer", rows: "integer" }],
|
|
1646
|
+
node: ["binary frames: raw stdout and stderr", { type: "exit", code: "integer or null" }, { type: "error", message: "string" }],
|
|
1647
|
+
},
|
|
1648
|
+
description: "An interactive shell or one operation's tty. The grant is `Nosana Terminal Authorization v1` followed by `job`, `node`, `expiresAt`, optional `op`, `network` and `audience: nosana-web-terminal` lines, valid for at most five minutes, signed by the job's owner.",
|
|
1649
|
+
},
|
|
1650
|
+
},
|
|
1651
|
+
},
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
//# sourceMappingURL=nodeOpenApi.js.map
|