@norskvideo/norsk-manager-sdk 1.0.402-2025-07-08-3c1224ec → 1.0.402-2025-07-09-56ffd6cf
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/dist/norsk-manager-sdk.d.ts +869 -0
- package/package.json +2 -2
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
export declare interface AwsHealth {
|
|
5
|
+
provider: "aws";
|
|
6
|
+
regions: {
|
|
7
|
+
[key: AwsRegion]: Health;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** @public */
|
|
12
|
+
export declare type AwsInstanceId = string;
|
|
13
|
+
|
|
14
|
+
/** @public */
|
|
15
|
+
export declare type AwsInstanceType = string;
|
|
16
|
+
|
|
17
|
+
/** @public */
|
|
18
|
+
export declare interface AwsLaunchTemplateId {
|
|
19
|
+
id: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** @public */
|
|
24
|
+
export declare interface AwsLaunchTemplateName {
|
|
25
|
+
name: string;
|
|
26
|
+
version?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** @public */
|
|
30
|
+
export declare type AwsMetadata = {
|
|
31
|
+
provider: "aws";
|
|
32
|
+
instanceType: AwsInstanceType;
|
|
33
|
+
region: AwsRegion;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @public */
|
|
37
|
+
export declare interface AwsNodeCreate {
|
|
38
|
+
nodeId: NodeId;
|
|
39
|
+
/**
|
|
40
|
+
* Tags to associate with the node
|
|
41
|
+
*/
|
|
42
|
+
tags: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
};
|
|
45
|
+
region: AwsRegion;
|
|
46
|
+
instanceType: string;
|
|
47
|
+
/**
|
|
48
|
+
* Launch template to use for the node
|
|
49
|
+
*/
|
|
50
|
+
template?: AwsLaunchTemplateName | AwsLaunchTemplateId;
|
|
51
|
+
workerImageVersion?: NorskVersion;
|
|
52
|
+
workerDaemonVersion?: NorskVersion;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** @public */
|
|
56
|
+
export declare type AwsNodeId = string;
|
|
57
|
+
|
|
58
|
+
/** @public */
|
|
59
|
+
export declare type AwsRegion = string;
|
|
60
|
+
|
|
61
|
+
/** @public */
|
|
62
|
+
export declare type ClientCode = DockerContainer;
|
|
63
|
+
|
|
64
|
+
/** @public */
|
|
65
|
+
export declare type Cloud = "aws" | "oci";
|
|
66
|
+
|
|
67
|
+
/** @public */
|
|
68
|
+
export declare type ContainerPort = number | RangePort;
|
|
69
|
+
|
|
70
|
+
/** @public */
|
|
71
|
+
export declare type ContainerUrl = string;
|
|
72
|
+
|
|
73
|
+
/** @public */
|
|
74
|
+
export declare type CreateJob = Omit<Job, "state" | "currentHash">;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export declare interface CurrentJob {
|
|
80
|
+
job: Job;
|
|
81
|
+
instances: RunningJob[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** @public */
|
|
85
|
+
export declare type DaemonVersion = string;
|
|
86
|
+
|
|
87
|
+
/** @public */
|
|
88
|
+
export declare type DateComparison = {
|
|
89
|
+
comparison: "eq";
|
|
90
|
+
value: Date;
|
|
91
|
+
} | {
|
|
92
|
+
comparison: "lt";
|
|
93
|
+
value: Date;
|
|
94
|
+
} | {
|
|
95
|
+
comparison: "lte";
|
|
96
|
+
value: Date;
|
|
97
|
+
} | {
|
|
98
|
+
comparison: "gt";
|
|
99
|
+
value: Date;
|
|
100
|
+
} | {
|
|
101
|
+
comparison: "gte";
|
|
102
|
+
value: Date;
|
|
103
|
+
} | {
|
|
104
|
+
comparison: "between";
|
|
105
|
+
from: Date;
|
|
106
|
+
to: Date;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @public */
|
|
110
|
+
export declare interface DateFilter {
|
|
111
|
+
filterType: "date";
|
|
112
|
+
dateType: "start" | "end";
|
|
113
|
+
comparison: DateComparison;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @public */
|
|
117
|
+
export declare type DockerContainer = {
|
|
118
|
+
codeType: "docker";
|
|
119
|
+
url: ContainerUrl;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** @public */
|
|
123
|
+
export declare type EnvironmentVariable = {
|
|
124
|
+
name: string;
|
|
125
|
+
value: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** @public */
|
|
129
|
+
export declare type EphemeralHostPort = {
|
|
130
|
+
type: "ephemeral";
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** @public */
|
|
134
|
+
export declare function eventStream(norsk: NorskManager, options: {
|
|
135
|
+
pendingWindow: number;
|
|
136
|
+
}): Promise<[EventStreamInitialState, EventStreamAsyncIterable]>;
|
|
137
|
+
|
|
138
|
+
declare interface EventStreamAsyncIterable {
|
|
139
|
+
[Symbol.asyncIterator](): AsyncIterator<EventStreamEvent, EventStreamEvent>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @public
|
|
144
|
+
* The manager activity stream has closed
|
|
145
|
+
* */
|
|
146
|
+
export declare interface EventStreamClosed {
|
|
147
|
+
event: "eventStreamClosed";
|
|
148
|
+
error?: Error;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
export declare type EventStreamEvent = JobUpdated | JobPending | JobOutOfWindow | JobDeleted | JobInfo | NodeStarting | NodeStarted | NodeStopping | NodeStopped | PhysicalNodeConnected | ProviderHealthChange | EventStreamClosed;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
export declare interface EventStreamInitialState {
|
|
160
|
+
nodesStarting: NodeStarting[];
|
|
161
|
+
nodesRunning: NodeRunning[];
|
|
162
|
+
activeJobs: JobWithHistory[];
|
|
163
|
+
health: ProviderHealth[];
|
|
164
|
+
closeStream: () => void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @public
|
|
169
|
+
* Configuration for creating an event stream
|
|
170
|
+
*/
|
|
171
|
+
export declare interface EventStreamSettings {
|
|
172
|
+
/**
|
|
173
|
+
* The number of seconds in the future to consider jobs as pending.
|
|
174
|
+
* Jobs that are further in the future will not surface in the event stream,
|
|
175
|
+
* and instead be only reachable through the search API.
|
|
176
|
+
*/
|
|
177
|
+
pendingWindow: number;
|
|
178
|
+
/**
|
|
179
|
+
* Callback for handling events from the event stream
|
|
180
|
+
* @param event - Event from the Manager
|
|
181
|
+
*/
|
|
182
|
+
onEvent: (event: EventStreamEvent) => void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
export declare type Health = "healthy" | "unstable" | "failed";
|
|
189
|
+
|
|
190
|
+
/** @public */
|
|
191
|
+
export declare type HostPort = EphemeralHostPort | RangePort | SpecificHostPort;
|
|
192
|
+
|
|
193
|
+
/** @public */
|
|
194
|
+
export declare type IdComparison = {
|
|
195
|
+
comparison: "eq";
|
|
196
|
+
value: string;
|
|
197
|
+
} | {
|
|
198
|
+
comparison: "neq";
|
|
199
|
+
value: string;
|
|
200
|
+
} | {
|
|
201
|
+
comparison: "re";
|
|
202
|
+
value: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/** @public */
|
|
206
|
+
export declare interface IdFilter {
|
|
207
|
+
filterType: "id";
|
|
208
|
+
comparison: IdComparison;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** @public */
|
|
212
|
+
export declare interface Job {
|
|
213
|
+
jobId: JobId;
|
|
214
|
+
cloud: Cloud;
|
|
215
|
+
description: string;
|
|
216
|
+
/**
|
|
217
|
+
* Tags to associate with the job
|
|
218
|
+
*/
|
|
219
|
+
tags: {
|
|
220
|
+
[key: string]: string;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Date and time for when the job should be started
|
|
224
|
+
*/
|
|
225
|
+
startDateTime: Date;
|
|
226
|
+
currentHash: bigint;
|
|
227
|
+
/**
|
|
228
|
+
* Additional services to be run as part of the job
|
|
229
|
+
*/
|
|
230
|
+
services: Service[];
|
|
231
|
+
volumes?: string[];
|
|
232
|
+
/**
|
|
233
|
+
* JSON configuration to be passed to the manager and stored with the job
|
|
234
|
+
*/
|
|
235
|
+
managerConfiguration?: string;
|
|
236
|
+
norskMediaVersion: NorskVersion;
|
|
237
|
+
/**
|
|
238
|
+
* Service parameters to be passed to the Norsk Media container when it is started
|
|
239
|
+
*/
|
|
240
|
+
norskServiceParameters?: ServiceParameters;
|
|
241
|
+
state: JobState;
|
|
242
|
+
shape: string;
|
|
243
|
+
availabilityDomain: string;
|
|
244
|
+
subnet: string;
|
|
245
|
+
architecture: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @public
|
|
250
|
+
* A job has been deleted
|
|
251
|
+
* */
|
|
252
|
+
export declare interface JobDeleted {
|
|
253
|
+
event: "jobDeleted";
|
|
254
|
+
jobId: JobId;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** @public */
|
|
258
|
+
export declare type JobFilter = TagFilter | IdFilter | DateFilter | StateFilter | NoFilter;
|
|
259
|
+
|
|
260
|
+
/** @public */
|
|
261
|
+
export declare type JobHistoryEntry = JobHistoryJobCreated | JobHistoryJobUpdated | JobHistoryJobProvisioned | JobHistoryJobRunning | JobHistoryJobStopping | JobHistoryJobStopped | JobHistoryJobCompleted;
|
|
262
|
+
|
|
263
|
+
/** @public */
|
|
264
|
+
export declare type JobHistoryJobCompleted = {
|
|
265
|
+
event: "completed";
|
|
266
|
+
timestamp: Date;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/** @public */
|
|
270
|
+
export declare type JobHistoryJobCreated = {
|
|
271
|
+
event: "created";
|
|
272
|
+
timestamp: Date;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/** @public */
|
|
276
|
+
export declare type JobHistoryJobProvisioned = {
|
|
277
|
+
event: "provisioned";
|
|
278
|
+
timestamp: Date;
|
|
279
|
+
role: Role;
|
|
280
|
+
nodeMetadata: NodeMetadata;
|
|
281
|
+
runningNodeMetadata: RunningNodeMetadata;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/** @public */
|
|
285
|
+
export declare type JobHistoryJobRunning = {
|
|
286
|
+
event: "running";
|
|
287
|
+
timestamp: Date;
|
|
288
|
+
role: Role;
|
|
289
|
+
nodeMetadata: NodeMetadata;
|
|
290
|
+
runningNodeMetadata: RunningNodeMetadata;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/** @public */
|
|
294
|
+
export declare type JobHistoryJobStopped = {
|
|
295
|
+
event: "stopped";
|
|
296
|
+
timestamp: Date;
|
|
297
|
+
role: Role;
|
|
298
|
+
nodeMetadata: NodeMetadata;
|
|
299
|
+
runningNodeMetadata?: RunningNodeMetadata;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
/** @public */
|
|
303
|
+
export declare type JobHistoryJobStopping = {
|
|
304
|
+
event: "stopping";
|
|
305
|
+
timestamp: Date;
|
|
306
|
+
role: Role;
|
|
307
|
+
nodeMetadata: NodeMetadata;
|
|
308
|
+
runningNodeMetadata?: RunningNodeMetadata;
|
|
309
|
+
reason: "nodeStopped" | "nodeTerminated" | "userRequested" | "unknownJob" | "jobFailed";
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/** @public */
|
|
313
|
+
export declare type JobHistoryJobUpdated = {
|
|
314
|
+
event: "updated";
|
|
315
|
+
timestamp: Date;
|
|
316
|
+
previousJob: Job;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/** @public */
|
|
320
|
+
export declare type JobId = string;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @public
|
|
324
|
+
* Informational messages about a job
|
|
325
|
+
* */
|
|
326
|
+
export declare interface JobInfo {
|
|
327
|
+
event: "jobInfo";
|
|
328
|
+
jobId: JobId;
|
|
329
|
+
role: Role;
|
|
330
|
+
timestamp: Date;
|
|
331
|
+
message: JobInfoMessage;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/** @public */
|
|
335
|
+
declare type JobInfoComponseMessage = {
|
|
336
|
+
type: "composeMessage";
|
|
337
|
+
stage: JobInfoComposeStage;
|
|
338
|
+
text: string;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/** @public */
|
|
342
|
+
declare type JobInfoComposeStage = "build" | "create" | "start" | "stop" | "down";
|
|
343
|
+
|
|
344
|
+
/** @public */
|
|
345
|
+
declare type JobInfoContainerEvent = {
|
|
346
|
+
type: "containerEvent";
|
|
347
|
+
serviceName: string;
|
|
348
|
+
text: string;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/** @public */
|
|
352
|
+
declare type JobInfoMessage = JobInfoServiceStarted | JobInfoServiceRestarting | JobInfoContainerEvent | JobInfoComponseMessage;
|
|
353
|
+
|
|
354
|
+
/** @public */
|
|
355
|
+
declare type JobInfoServiceRestarting = {
|
|
356
|
+
type: "serviceRestarting";
|
|
357
|
+
serviceName: string;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/** @public */
|
|
361
|
+
declare type JobInfoServiceStarted = {
|
|
362
|
+
type: "serviceStarted";
|
|
363
|
+
serviceName: string;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @public
|
|
368
|
+
* List of events that can be raised by the jobList API - TODO - link
|
|
369
|
+
*/
|
|
370
|
+
export declare type JobListEvent = JobUpdated | JobPending;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @public
|
|
374
|
+
* A job has been updated such that it no longer matches the search criteria
|
|
375
|
+
* */
|
|
376
|
+
export declare interface JobOutOfWindow {
|
|
377
|
+
event: "jobOutOfWindow";
|
|
378
|
+
jobWithHistory: JobWithHistory;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @public
|
|
383
|
+
* Job is almost ready to start - "almost" defined by property passed into
|
|
384
|
+
* the list functions - todo, sort out this description
|
|
385
|
+
* */
|
|
386
|
+
export declare interface JobPending {
|
|
387
|
+
event: "jobPending";
|
|
388
|
+
jobWithHistory: JobWithHistory;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @public
|
|
393
|
+
*/
|
|
394
|
+
export declare interface JobSearchSettings {
|
|
395
|
+
filter: JobFilter[];
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** @public */
|
|
399
|
+
export declare type JobState = "pre" | "active" | "post";
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @public
|
|
403
|
+
* Job details have been updated
|
|
404
|
+
* */
|
|
405
|
+
export declare interface JobUpdated {
|
|
406
|
+
event: "jobUpdated";
|
|
407
|
+
jobWithHistory: JobWithHistory;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/** @public */
|
|
411
|
+
export declare interface JobWithHistory {
|
|
412
|
+
job: Job;
|
|
413
|
+
/**
|
|
414
|
+
* All the events related to this job
|
|
415
|
+
* */
|
|
416
|
+
history: JobHistoryEntry[];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/** @public */
|
|
420
|
+
export declare type Log = {
|
|
421
|
+
level: "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "info" | "debug";
|
|
422
|
+
timestamp: Date;
|
|
423
|
+
message: string;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/** @public */
|
|
427
|
+
export declare type NodeId = string;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @public
|
|
431
|
+
* State of a node
|
|
432
|
+
*/
|
|
433
|
+
export declare type NodeInfo = NodePending | NodeStarting | NodeRunning | NodeStopping;
|
|
434
|
+
|
|
435
|
+
/** @public */
|
|
436
|
+
export declare type NodeMetadata = {
|
|
437
|
+
nodeId: NodeId;
|
|
438
|
+
tags: {
|
|
439
|
+
[key: string]: string;
|
|
440
|
+
};
|
|
441
|
+
createdAt?: Date;
|
|
442
|
+
providerMetadata: ProviderMetadata;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @public
|
|
447
|
+
* A node is pending
|
|
448
|
+
*/
|
|
449
|
+
export declare interface NodePending {
|
|
450
|
+
event: "nodePending";
|
|
451
|
+
nodeId: NodeId;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* @public
|
|
456
|
+
* A node is running - used in initial state messages
|
|
457
|
+
* */
|
|
458
|
+
export declare interface NodeRunning {
|
|
459
|
+
event: "nodeRunning";
|
|
460
|
+
nodeMetadata: NodeMetadata;
|
|
461
|
+
runningNodeMetadata: RunningNodeMetadata;
|
|
462
|
+
instances: RunningJob[];
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @public
|
|
467
|
+
* A node has started
|
|
468
|
+
* */
|
|
469
|
+
export declare type NodeStarted = {
|
|
470
|
+
event: "nodeStarted";
|
|
471
|
+
nodeMetadata: NodeMetadata;
|
|
472
|
+
runningNodeMetadata: RunningNodeMetadata;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @public
|
|
477
|
+
* A node is starting
|
|
478
|
+
* */
|
|
479
|
+
export declare interface NodeStarting {
|
|
480
|
+
event: "nodeStarting";
|
|
481
|
+
nodeMetadata: NodeMetadata;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* @public
|
|
486
|
+
* A node has stopped
|
|
487
|
+
* */
|
|
488
|
+
export declare interface NodeStopped {
|
|
489
|
+
event: "nodeStopped";
|
|
490
|
+
nodeId: NodeId;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* @public
|
|
495
|
+
* A node is stopping
|
|
496
|
+
* */
|
|
497
|
+
export declare interface NodeStopping {
|
|
498
|
+
event: "nodeStopping";
|
|
499
|
+
nodeId: NodeId;
|
|
500
|
+
reason: "createFailed" | "pendingTimeExceeded" | "startupTimeExceeded" | "initialisationHealthPingTimeExceeded" | "healthPingTimeExceeded" | "duplicateJob" | "providerStop" | "providerTerminate" | "userRequested" | "unknownNode";
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/** @public */
|
|
504
|
+
export declare interface NoFilter {
|
|
505
|
+
filterType: "none";
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* @public
|
|
510
|
+
* The entrypoint for all Norsk Manager applications
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```ts
|
|
514
|
+
* const norsk = await NorskManager.connect({ url: "localhost:6790" });
|
|
515
|
+
* ```
|
|
516
|
+
*/
|
|
517
|
+
export declare class NorskManager {
|
|
518
|
+
/** @public
|
|
519
|
+
* Connect to the Norsk Manager
|
|
520
|
+
*/
|
|
521
|
+
static connect(settings: NorskSettings): Promise<NorskManager>;
|
|
522
|
+
/**
|
|
523
|
+
* @public
|
|
524
|
+
* Norsk Runtime version information
|
|
525
|
+
*/
|
|
526
|
+
version: VersionInfo;
|
|
527
|
+
/**
|
|
528
|
+
* @public
|
|
529
|
+
* Close down the Norsk connection
|
|
530
|
+
*/
|
|
531
|
+
close(): void;
|
|
532
|
+
/**
|
|
533
|
+
* @public
|
|
534
|
+
* Create a new job
|
|
535
|
+
*/
|
|
536
|
+
createJob(job: CreateJob): Promise<Job>;
|
|
537
|
+
/**
|
|
538
|
+
* @public
|
|
539
|
+
* Update a job
|
|
540
|
+
*/
|
|
541
|
+
updateJob(job: Job): Promise<Job>;
|
|
542
|
+
/**
|
|
543
|
+
* @public
|
|
544
|
+
* Deletes a job
|
|
545
|
+
*/
|
|
546
|
+
deleteJob(jobId: JobId): Promise<void>;
|
|
547
|
+
/**
|
|
548
|
+
* @public
|
|
549
|
+
* Stops a running job
|
|
550
|
+
*/
|
|
551
|
+
completeJob(jobId: JobId): Promise<void>;
|
|
552
|
+
/**
|
|
553
|
+
* @public
|
|
554
|
+
* Spawn a new EC2 instance running the worker image, and make it available for picking up jobs
|
|
555
|
+
*/
|
|
556
|
+
createAwsNode(node: AwsNodeCreate): Promise<void>;
|
|
557
|
+
/**
|
|
558
|
+
* @public
|
|
559
|
+
* Spawn a new OCI instance running the worker image, and make it available for picking up jobs
|
|
560
|
+
*/
|
|
561
|
+
createOciNode(node: OciNodeCreate): Promise<void>;
|
|
562
|
+
/**
|
|
563
|
+
* @public
|
|
564
|
+
* Forcibly stop a node
|
|
565
|
+
*/
|
|
566
|
+
terminateNode(nodeId: NodeId): Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* @public
|
|
569
|
+
* Start a job on a node
|
|
570
|
+
* @param jobId - The job to start
|
|
571
|
+
* @param role - The role for this node, such as e.g. "primary" or "backup"
|
|
572
|
+
* @param nodeId - The node to start the job on
|
|
573
|
+
*/
|
|
574
|
+
startJob(jobId: JobId, role: Role, nodeId: NodeId): Promise<void>;
|
|
575
|
+
/**
|
|
576
|
+
* @public
|
|
577
|
+
* Stop a job running on a node
|
|
578
|
+
* @param jobId - The job to stop
|
|
579
|
+
* @param role - The role for this node, such as e.g. "primary" or "backup"
|
|
580
|
+
* @param nodeId - The node to stop the job on
|
|
581
|
+
*/
|
|
582
|
+
stopJob(jobId: JobId, role: Role, nodeId: NodeId): Promise<void>;
|
|
583
|
+
/**
|
|
584
|
+
* @public
|
|
585
|
+
* Provides a stream of the activity that is happening on the server-side.
|
|
586
|
+
* Reacting to these events is essential for the creation of client-side management logic.
|
|
587
|
+
*/
|
|
588
|
+
eventStream(settings: EventStreamSettings): Promise<[EventStreamInitialState, () => void]>;
|
|
589
|
+
/**
|
|
590
|
+
* @public
|
|
591
|
+
* Search for jobs by id
|
|
592
|
+
*/
|
|
593
|
+
jobById(id: JobId): Promise<CurrentJob | undefined>;
|
|
594
|
+
/**
|
|
595
|
+
* @public
|
|
596
|
+
* Search for jobs by tag/date/etc. See {@link JobSearchSettings}
|
|
597
|
+
*/
|
|
598
|
+
jobSearch(settings: JobSearchSettings): Promise<CurrentJob[]>;
|
|
599
|
+
/**
|
|
600
|
+
* @public
|
|
601
|
+
* Return a list a all the nodes the manager knows about.
|
|
602
|
+
*/
|
|
603
|
+
listNodes(): Promise<NodeInfo[]>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @public
|
|
608
|
+
* Top level Norsk configuration
|
|
609
|
+
*/
|
|
610
|
+
export declare interface NorskSettings {
|
|
611
|
+
/**
|
|
612
|
+
* Callback URL to listen on for gRPC session with Norsk Manager
|
|
613
|
+
*
|
|
614
|
+
*/
|
|
615
|
+
url?: string;
|
|
616
|
+
/**
|
|
617
|
+
* Called when attempting a connection to the Norsk Manager
|
|
618
|
+
*/
|
|
619
|
+
onAttemptingToConnect?: () => void;
|
|
620
|
+
/**
|
|
621
|
+
* Called when a connection to the Norsk Manager is being established
|
|
622
|
+
*/
|
|
623
|
+
onConnecting?: () => void;
|
|
624
|
+
/**
|
|
625
|
+
* Called when a connection to the Norsk Manager is ready
|
|
626
|
+
*/
|
|
627
|
+
onReady?: () => void;
|
|
628
|
+
/**
|
|
629
|
+
* Called when a connection to the Norsk Manager has failed
|
|
630
|
+
*/
|
|
631
|
+
onFailedToConnect?: () => void;
|
|
632
|
+
/**
|
|
633
|
+
* Called when Norsk Manager is shutting down the connection
|
|
634
|
+
*/
|
|
635
|
+
onShutdown?: () => void;
|
|
636
|
+
/**
|
|
637
|
+
* Called when receiving the version information from the Norsk Manager
|
|
638
|
+
* @param version - Version information
|
|
639
|
+
* */
|
|
640
|
+
onHello?: (version: VersionInfo) => void;
|
|
641
|
+
/**
|
|
642
|
+
* Called whenever a log event is received from the Norsk Manager
|
|
643
|
+
* @param log - Log event
|
|
644
|
+
* */
|
|
645
|
+
onLogEvent?: (log: Log) => void;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/** @public */
|
|
649
|
+
export declare type NorskVersion = "latest" | "recommended" | "previousRecommended" | "LTS";
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* @public
|
|
653
|
+
*/
|
|
654
|
+
export declare interface OciHealth {
|
|
655
|
+
provider: "oci";
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** @public */
|
|
659
|
+
export declare type OciMetadata = {
|
|
660
|
+
provider: "oci";
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
/** @public */
|
|
664
|
+
export declare interface OciNodeCreate {
|
|
665
|
+
nodeId: NodeId;
|
|
666
|
+
/**
|
|
667
|
+
* Tags to associate with the node
|
|
668
|
+
*/
|
|
669
|
+
tags: {
|
|
670
|
+
[key: string]: string;
|
|
671
|
+
};
|
|
672
|
+
availabilityDomain: OciRegion;
|
|
673
|
+
architecture: string;
|
|
674
|
+
shape: string;
|
|
675
|
+
subnet: string;
|
|
676
|
+
workerImageVersion?: NorskVersion;
|
|
677
|
+
workerDaemonVersion?: NorskVersion;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/** @public */
|
|
681
|
+
export declare type OciRegion = string;
|
|
682
|
+
|
|
683
|
+
/** @public */
|
|
684
|
+
export declare type PhysicalNode = {
|
|
685
|
+
nodeType: "physical";
|
|
686
|
+
id: PhysicalNodeId;
|
|
687
|
+
tags: {
|
|
688
|
+
[key: string]: string;
|
|
689
|
+
};
|
|
690
|
+
ipAddress: string;
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @public
|
|
695
|
+
* A physical node has connected
|
|
696
|
+
* */
|
|
697
|
+
export declare interface PhysicalNodeConnected {
|
|
698
|
+
event: "physicalNodeConnected";
|
|
699
|
+
node: PhysicalNode;
|
|
700
|
+
instances: RunningJob[];
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/** @public */
|
|
704
|
+
export declare type PhysicalNodeId = string;
|
|
705
|
+
|
|
706
|
+
/** @public */
|
|
707
|
+
export declare type PortMapping = {
|
|
708
|
+
containerPort: ContainerPort;
|
|
709
|
+
protocol?: "tcp" | "udp";
|
|
710
|
+
hostPort: HostPort;
|
|
711
|
+
hostAddress?: string;
|
|
712
|
+
group?: string;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* @public
|
|
717
|
+
*/
|
|
718
|
+
export declare type ProviderHealth = AwsHealth | OciHealth;
|
|
719
|
+
|
|
720
|
+
/**;
|
|
721
|
+
* @public
|
|
722
|
+
* The health status of a provider has changed
|
|
723
|
+
* */
|
|
724
|
+
export declare interface ProviderHealthChange {
|
|
725
|
+
event: "providerHealthChange";
|
|
726
|
+
health: ProviderHealth;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/** @public */
|
|
730
|
+
export declare type ProviderMetadata = AwsMetadata | OciMetadata;
|
|
731
|
+
|
|
732
|
+
/** @public */
|
|
733
|
+
export declare type RangePort = {
|
|
734
|
+
type: "range";
|
|
735
|
+
minPort: number;
|
|
736
|
+
maxPort: number;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
/** @public */
|
|
740
|
+
export declare type RestartIntensity = {
|
|
741
|
+
count: number;
|
|
742
|
+
period: number;
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
/** @public */
|
|
746
|
+
export declare type Role = string;
|
|
747
|
+
|
|
748
|
+
/** @public */
|
|
749
|
+
export declare type RunningAwsMetadata = {
|
|
750
|
+
provider: "aws";
|
|
751
|
+
instanceId: AwsInstanceId;
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
/** @public */
|
|
755
|
+
export declare type RunningJob = {
|
|
756
|
+
jobId: JobId;
|
|
757
|
+
role: Role;
|
|
758
|
+
nodeId: NodeId;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
/** @public */
|
|
762
|
+
export declare type RunningNodeMetadata = {
|
|
763
|
+
publicDnsName: string;
|
|
764
|
+
privateDnsName: string;
|
|
765
|
+
privateIpAddress: string;
|
|
766
|
+
publicIpAddress: string;
|
|
767
|
+
providerMetadata: RunningNodeProviderMetadata;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
/** @public */
|
|
771
|
+
export declare type RunningNodeProviderMetadata = RunningAwsMetadata | RunningOciMetadata;
|
|
772
|
+
|
|
773
|
+
/** @public */
|
|
774
|
+
export declare type RunningOciMetadata = {
|
|
775
|
+
provider: "oci";
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/** @public */
|
|
779
|
+
export declare type Service = {
|
|
780
|
+
name: string;
|
|
781
|
+
container: ClientCode;
|
|
782
|
+
restart?: ServiceRestart;
|
|
783
|
+
dependsOn?: Set<string>;
|
|
784
|
+
configuration?: string;
|
|
785
|
+
restartIntensity?: RestartIntensity;
|
|
786
|
+
command?: string;
|
|
787
|
+
parameters?: ServiceParameters;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
/** @public */
|
|
791
|
+
export declare type ServiceParameters = {
|
|
792
|
+
portMappings?: PortMapping[];
|
|
793
|
+
environmentVariables?: EnvironmentVariable[];
|
|
794
|
+
sharedMemorySize?: bigint;
|
|
795
|
+
cpuSet?: number[];
|
|
796
|
+
volumeMounts?: VolumeMount[];
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
/** @public */
|
|
800
|
+
export declare type ServiceRestart = "never" | "onFailure" | "always";
|
|
801
|
+
|
|
802
|
+
/** @public */
|
|
803
|
+
export declare type SpecificHostPort = {
|
|
804
|
+
type: "specific";
|
|
805
|
+
port: number;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
/** @public */
|
|
809
|
+
export declare type StateComparison = {
|
|
810
|
+
comparison: "eq";
|
|
811
|
+
value: JobState;
|
|
812
|
+
} | {
|
|
813
|
+
comparison: "neq";
|
|
814
|
+
value: JobState;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
/** @public */
|
|
818
|
+
export declare interface StateFilter {
|
|
819
|
+
filterType: "state";
|
|
820
|
+
comparison: StateComparison;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/** @public */
|
|
824
|
+
export declare type TagComparison = {
|
|
825
|
+
comparison: "eq";
|
|
826
|
+
value: string;
|
|
827
|
+
} | {
|
|
828
|
+
comparison: "neq";
|
|
829
|
+
value: string;
|
|
830
|
+
} | {
|
|
831
|
+
comparison: "re";
|
|
832
|
+
value: string;
|
|
833
|
+
} | {
|
|
834
|
+
comparison: "exists";
|
|
835
|
+
value: boolean;
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
/** @public */
|
|
839
|
+
export declare interface TagFilter {
|
|
840
|
+
filterType: "tag";
|
|
841
|
+
tagName: string;
|
|
842
|
+
comparison: TagComparison;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @public
|
|
847
|
+
* Norsk Manager Version information
|
|
848
|
+
*/
|
|
849
|
+
export declare interface VersionInfo {
|
|
850
|
+
/** Major version */
|
|
851
|
+
majorVersion: number;
|
|
852
|
+
/** Minor version */
|
|
853
|
+
minorVersion: number;
|
|
854
|
+
/** Build number for this version */
|
|
855
|
+
buildNumber: number;
|
|
856
|
+
/** Git branch at time of build */
|
|
857
|
+
branchName: string;
|
|
858
|
+
/** Unique identifier for this build */
|
|
859
|
+
label: string;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/** @public */
|
|
863
|
+
export declare type VolumeMount = {
|
|
864
|
+
volumeName: string;
|
|
865
|
+
containerPath: string;
|
|
866
|
+
readOnly: boolean;
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "MIT",
|
|
3
3
|
"name": "@norskvideo/norsk-manager-sdk",
|
|
4
|
-
"version": "1.0.402-2025-07-
|
|
4
|
+
"version": "1.0.402-2025-07-09-56ffd6cf+nightly",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@bufbuild/protobuf": "^0.3.0",
|
|
7
7
|
"@grpc/grpc-js": "~1.12.0",
|
|
8
|
-
"@norskvideo/norsk-api": "1.0.402-2025-07-
|
|
8
|
+
"@norskvideo/norsk-api": "1.0.402-2025-07-09-56ffd6cf+nightly",
|
|
9
9
|
"typescript-nullable": "^0.6.0"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|