@kinotic-ai/system-api 5.0.0-beta.2 → 5.0.0-beta.21
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/index.cjs +104 -120
- package/dist/index.d.cts +197 -288
- package/dist/index.d.ts +197 -288
- package/dist/index.js +107 -121
- package/package.json +5 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,87 +1,26 @@
|
|
|
1
1
|
import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
|
|
2
|
+
import { ReconcileState, Reconcilable } from "@kinotic-ai/management-api";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Whether a node is taking workloads, as the node reports it. A node the platform cannot reach is
|
|
5
|
+
* not a phase the node can report: it carries the condition NODE_UNREACHABLE beside what it last
|
|
6
|
+
* reported.
|
|
6
7
|
*/
|
|
7
|
-
declare class LogPolicy {
|
|
8
|
-
/**
|
|
9
|
-
* Size at which the workload's current log file is rotated.
|
|
10
|
-
*/
|
|
11
|
-
maxSizeMb: number;
|
|
12
|
-
/**
|
|
13
|
-
* How many rotated files are kept alongside the current one. The oldest is discarded
|
|
14
|
-
* once this many exist, so a workload's logs occupy at most maxSizeMb * (maxFiles + 1).
|
|
15
|
-
*/
|
|
16
|
-
maxFiles: number;
|
|
17
|
-
}
|
|
18
|
-
declare enum NetworkMode {
|
|
19
|
-
ENABLED = "ENABLED",
|
|
20
|
-
/**
|
|
21
|
-
* No network access. Nothing outside the VM is reachable, by name or by address, and
|
|
22
|
-
* any NetworkPolicy.allowedHosts the workload declares does not apply.
|
|
23
|
-
*/
|
|
24
|
-
DISABLED = "DISABLED"
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The network access granted to a workload's VM. The workload's own image and entrypoint
|
|
28
|
-
* have no say in it: the policy is applied by the VM provider when the VM is created,
|
|
29
|
-
* which is what makes it safe to run code the platform does not trust.
|
|
30
|
-
*/
|
|
31
|
-
declare class NetworkPolicy {
|
|
32
|
-
/**
|
|
33
|
-
* Whether the VM has network access at all.
|
|
34
|
-
*/
|
|
35
|
-
mode: NetworkMode;
|
|
36
|
-
/**
|
|
37
|
-
* The outbound destinations the VM may reach, including the api-gateway the workload is
|
|
38
|
-
* deployed to talk to. An empty list denies every destination, leaving the VM able to
|
|
39
|
-
* resolve names and reach nothing. Applies only when mode is ENABLED.
|
|
40
|
-
*
|
|
41
|
-
* What an entry may be follows the provider of the node the workload is placed on:
|
|
42
|
-
* CLOUD_HYPERVISOR takes IPv4 addresses and CIDRs, enforced by the node's firewall, and
|
|
43
|
-
* BOXLITE takes hostnames, enforced on the connection so an unlisted destination is
|
|
44
|
-
* unreachable by name and by raw IP alike.
|
|
45
|
-
*/
|
|
46
|
-
allowedHosts: string[];
|
|
47
|
-
}
|
|
48
|
-
declare enum PortProtocol {
|
|
49
|
-
TCP = "TCP",
|
|
50
|
-
UDP = "UDP"
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* A guest port exposed on the host for a workload's VM.
|
|
54
|
-
*/
|
|
55
|
-
interface PortMapping {
|
|
56
|
-
/** Host port to expose. When omitted, the provider assigns one. */
|
|
57
|
-
hostPort?: number;
|
|
58
|
-
/** Guest port to map to the host. */
|
|
59
|
-
guestPort: number;
|
|
60
|
-
/** Transport protocol. When omitted, the provider's default applies. */
|
|
61
|
-
protocol?: PortProtocol;
|
|
62
|
-
/** Host interface to bind on. When omitted, the provider's default applies. */
|
|
63
|
-
hostIp?: string;
|
|
64
|
-
}
|
|
65
|
-
import { Identifiable } from "@kinotic-ai/core";
|
|
66
8
|
declare enum VmNodeStatusType {
|
|
67
9
|
ONLINE = "ONLINE",
|
|
68
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The node reported something it can no longer guarantee: it keeps the workloads it has and takes
|
|
12
|
+
* no more until it reports no problems.
|
|
13
|
+
*/
|
|
69
14
|
DRAINING = "DRAINING"
|
|
70
15
|
}
|
|
71
16
|
/**
|
|
72
|
-
*
|
|
17
|
+
* The reconciled state of a node: the shape both the intent and the observation take, so a node is
|
|
18
|
+
* in its desired state exactly when the two are equal. Intent is that the node takes workloads;
|
|
19
|
+
* observation is what the node reports it can do.
|
|
73
20
|
*/
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
*/
|
|
78
|
-
type: VmNodeStatusType;
|
|
79
|
-
/**
|
|
80
|
-
* Why the node is not taking workloads, or null when it is. Set from the node's own report
|
|
81
|
-
* of the guarantees it can still make — a data root that stopped enforcing disk limits, or
|
|
82
|
-
* a firewall that stopped hiding host credentials from guests.
|
|
83
|
-
*/
|
|
84
|
-
healthMessage: string | null;
|
|
21
|
+
interface VmNodeState {
|
|
22
|
+
/** Whether the node takes workloads. */
|
|
23
|
+
phase: VmNodeStatusType;
|
|
85
24
|
}
|
|
86
25
|
declare enum VmProviderType {
|
|
87
26
|
BOXLITE = "BOXLITE",
|
|
@@ -91,7 +30,7 @@ declare enum VmProviderType {
|
|
|
91
30
|
* Represents a node in the cluster that is running a VmManager process
|
|
92
31
|
* and is capable of hosting workloads.
|
|
93
32
|
*/
|
|
94
|
-
declare class VmNode implements
|
|
33
|
+
declare class VmNode implements Reconcilable<VmNodeState> {
|
|
95
34
|
/**
|
|
96
35
|
* Unique identifier for this node.
|
|
97
36
|
*/
|
|
@@ -105,9 +44,17 @@ declare class VmNode implements Identifiable<string> {
|
|
|
105
44
|
*/
|
|
106
45
|
hostname: string;
|
|
107
46
|
/**
|
|
108
|
-
*
|
|
47
|
+
* What the node should be, taking workloads, and what it reports it is, with what the platform
|
|
48
|
+
* inferred beside the node's word: that it fell silent, or that a call to it could not be
|
|
49
|
+
* delivered. A node is placeable exactly when this is reconciled.
|
|
109
50
|
*/
|
|
110
|
-
|
|
51
|
+
state: ReconcileState<VmNodeState>;
|
|
52
|
+
/**
|
|
53
|
+
* Why the node is not taking workloads, or null when it is. Set from the node's own report of
|
|
54
|
+
* the guarantees it can still make — a data root that stopped enforcing disk limits, or a
|
|
55
|
+
* firewall that stopped hiding host credentials from guests.
|
|
56
|
+
*/
|
|
57
|
+
healthMessage: string | null;
|
|
111
58
|
/**
|
|
112
59
|
* The VM provider this node runs every workload on, determined by how the node was
|
|
113
60
|
* provisioned and reported when it registers.
|
|
@@ -126,17 +73,18 @@ declare class VmNode implements Identifiable<string> {
|
|
|
126
73
|
*/
|
|
127
74
|
totalDiskMb: number;
|
|
128
75
|
/**
|
|
129
|
-
*
|
|
76
|
+
* CPU not allocated to any workload, in cores. What is allocated is
|
|
77
|
+
* totalCpus - freeCpus, what the workloads running on the node are sized for.
|
|
130
78
|
*/
|
|
131
|
-
|
|
79
|
+
freeCpus: number;
|
|
132
80
|
/**
|
|
133
|
-
* Memory
|
|
81
|
+
* Memory not allocated to any workload, in megabytes.
|
|
134
82
|
*/
|
|
135
|
-
|
|
83
|
+
freeMemoryMb: number;
|
|
136
84
|
/**
|
|
137
|
-
* Disk space
|
|
85
|
+
* Disk space not allocated to any workload, in megabytes.
|
|
138
86
|
*/
|
|
139
|
-
|
|
87
|
+
freeDiskMb: number;
|
|
140
88
|
/**
|
|
141
89
|
* The date and time the node was last seen/heartbeat.
|
|
142
90
|
*/
|
|
@@ -149,154 +97,6 @@ declare class VmNode implements Identifiable<string> {
|
|
|
149
97
|
constructor(id: string, name: string, hostname: string);
|
|
150
98
|
}
|
|
151
99
|
/**
|
|
152
|
-
* A host directory exposed inside a workload's guest VM.
|
|
153
|
-
*/
|
|
154
|
-
interface VolumeMount {
|
|
155
|
-
/** Absolute path on the host to mount into the guest. */
|
|
156
|
-
hostPath: string;
|
|
157
|
-
/** Absolute path inside the guest where the host path is mounted. */
|
|
158
|
-
guestPath: string;
|
|
159
|
-
/** When true, the mount is exposed read-only inside the guest. Defaults to false. */
|
|
160
|
-
readOnly?: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Hard cap in megabytes on what the guest may write through this mount. Unset leaves the
|
|
163
|
-
* mount bounded only by the host filesystem it comes from. Applies to writable mounts,
|
|
164
|
-
* since a read-only mount is already unwritable.
|
|
165
|
-
*/
|
|
166
|
-
sizeLimitMb?: number;
|
|
167
|
-
}
|
|
168
|
-
import { Identifiable as Identifiable2 } from "@kinotic-ai/core";
|
|
169
|
-
declare enum WorkloadStatus {
|
|
170
|
-
PENDING = "PENDING",
|
|
171
|
-
STARTING = "STARTING",
|
|
172
|
-
RUNNING = "RUNNING",
|
|
173
|
-
STOPPING = "STOPPING",
|
|
174
|
-
STOPPED = "STOPPED",
|
|
175
|
-
FAILED = "FAILED"
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Represents a workload to be managed by the VM manager.
|
|
179
|
-
* A workload defines the configuration for a micro VM instance.
|
|
180
|
-
*/
|
|
181
|
-
declare class Workload implements Identifiable2<string> {
|
|
182
|
-
/**
|
|
183
|
-
* Unique identifier for this workload.
|
|
184
|
-
*/
|
|
185
|
-
id: string | null;
|
|
186
|
-
/**
|
|
187
|
-
* Human-readable name for the workload.
|
|
188
|
-
*/
|
|
189
|
-
name: string;
|
|
190
|
-
/**
|
|
191
|
-
* Optional description of the workload.
|
|
192
|
-
*/
|
|
193
|
-
description?: string;
|
|
194
|
-
/**
|
|
195
|
-
* The id of the node this workload is deployed to, assigned by the orchestrator
|
|
196
|
-
* during deployment, or set by the caller before deploying to pin the workload to a
|
|
197
|
-
* specific node. Null until the workload has been placed.
|
|
198
|
-
*/
|
|
199
|
-
nodeId: string | null;
|
|
200
|
-
/**
|
|
201
|
-
* The Organization this workload runs on behalf of, and which may view its logs.
|
|
202
|
-
* Null for platform workloads (SYSTEM scope).
|
|
203
|
-
*/
|
|
204
|
-
organizationId: string | null;
|
|
205
|
-
/**
|
|
206
|
-
* The Application this workload runs on behalf of, or null if none.
|
|
207
|
-
* When set, organizationId must also be set.
|
|
208
|
-
*/
|
|
209
|
-
applicationId: string | null;
|
|
210
|
-
/**
|
|
211
|
-
* The image or rootfs to use for the VM.
|
|
212
|
-
*/
|
|
213
|
-
image: string;
|
|
214
|
-
/**
|
|
215
|
-
* Number of vCPUs allocated to the VM.
|
|
216
|
-
*/
|
|
217
|
-
vcpus: number;
|
|
218
|
-
/**
|
|
219
|
-
* Memory allocated to the VM in megabytes.
|
|
220
|
-
*/
|
|
221
|
-
memoryMb: number;
|
|
222
|
-
/**
|
|
223
|
-
* Disk size allocated to the VM in megabytes.
|
|
224
|
-
*/
|
|
225
|
-
diskSizeMb: number;
|
|
226
|
-
/**
|
|
227
|
-
* The network access granted to this workload's VM.
|
|
228
|
-
*/
|
|
229
|
-
network: NetworkPolicy;
|
|
230
|
-
/**
|
|
231
|
-
* How much of this workload's log output the node keeps.
|
|
232
|
-
*/
|
|
233
|
-
logPolicy: LogPolicy;
|
|
234
|
-
/**
|
|
235
|
-
* When true the VM runs detached from the vm-manager process and survives its restarts,
|
|
236
|
-
* and calls that start its run (deploy, restart) complete as soon as it is running.
|
|
237
|
-
* When false the workload runs in the foreground: it ends when the vm-manager exits,
|
|
238
|
-
* and calls that start its run complete only once the run has ended — STOPPED or
|
|
239
|
-
* FAILED, with the exit code set.
|
|
240
|
-
*/
|
|
241
|
-
detached: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* When true the VM and its disk are discarded when the workload stops, so a
|
|
244
|
-
* stopped workload cannot be restarted. When false the disk is kept and the
|
|
245
|
-
* workload may be restarted in place.
|
|
246
|
-
*/
|
|
247
|
-
autoRemove: boolean;
|
|
248
|
-
/**
|
|
249
|
-
* Current status of the workload.
|
|
250
|
-
*/
|
|
251
|
-
status: WorkloadStatus;
|
|
252
|
-
/**
|
|
253
|
-
* The exit status of the workload's process once it has stopped, null while it has not.
|
|
254
|
-
* A workload killed by a signal reports 128 plus the signal number, so 137 is a SIGKILL —
|
|
255
|
-
* which is what a workload that exceeded its memory limit receives, with no chance to
|
|
256
|
-
* shut down first. FAILED alone does not distinguish that from code that threw.
|
|
257
|
-
*/
|
|
258
|
-
exitCode: number | null;
|
|
259
|
-
/**
|
|
260
|
-
* Optional environment variables to pass to the VM. Persisted verbatim on the workload
|
|
261
|
-
* record — put values that must not be readable there in secrets instead.
|
|
262
|
-
*/
|
|
263
|
-
environment: Record<string, string>;
|
|
264
|
-
/**
|
|
265
|
-
* Optional secret environment variables to pass to the VM, delivered to the guest
|
|
266
|
-
* exactly like environment and overriding it on a duplicate key. The persisted workload
|
|
267
|
-
* record holds a masked value for every entry — reading a workload back returns the keys
|
|
268
|
-
* but never the values, which only the node receives.
|
|
269
|
-
*/
|
|
270
|
-
secrets: Record<string, string>;
|
|
271
|
-
/**
|
|
272
|
-
* Port mappings that expose guest ports on the host.
|
|
273
|
-
*/
|
|
274
|
-
portMappings: PortMapping[];
|
|
275
|
-
/**
|
|
276
|
-
* Volume mounts that expose host directories inside the guest VM.
|
|
277
|
-
*/
|
|
278
|
-
volumeMounts: VolumeMount[];
|
|
279
|
-
/**
|
|
280
|
-
* Overrides the image entrypoint. Empty keeps the image default.
|
|
281
|
-
*/
|
|
282
|
-
entrypoint: string[];
|
|
283
|
-
/**
|
|
284
|
-
* Overrides the image command (CMD). Empty keeps the image default, unless
|
|
285
|
-
* entrypoint is declared — then the image CMD is dropped so the entrypoint
|
|
286
|
-
* runs exactly as given.
|
|
287
|
-
*/
|
|
288
|
-
cmd: string[];
|
|
289
|
-
/**
|
|
290
|
-
* The date and time the workload was created.
|
|
291
|
-
*/
|
|
292
|
-
created: number | null;
|
|
293
|
-
/**
|
|
294
|
-
* The date and time the workload was last updated.
|
|
295
|
-
*/
|
|
296
|
-
updated: number | null;
|
|
297
|
-
constructor(name: string, image: string);
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
100
|
* DTO sent by a vm-manager process when it registers with the server.
|
|
301
101
|
* Contains only the information the node knows about itself.
|
|
302
102
|
*/
|
|
@@ -335,6 +135,7 @@ declare class VmNodeRegistration {
|
|
|
335
135
|
workloadDataDir: string | null;
|
|
336
136
|
constructor(id: string, name: string, hostname: string);
|
|
337
137
|
}
|
|
138
|
+
import { WorkloadStatus } from "@kinotic-ai/management-api";
|
|
338
139
|
/**
|
|
339
140
|
* A vm-manager node's view of one workload's status, reported to the orchestrator.
|
|
340
141
|
*/
|
|
@@ -348,17 +149,18 @@ interface WorkloadStatusReport {
|
|
|
348
149
|
/** When the node recorded this status, in epoch milliseconds. */
|
|
349
150
|
updated: number;
|
|
350
151
|
}
|
|
152
|
+
import { WatchEvent } from "@kinotic-ai/management-api";
|
|
351
153
|
import { IKinotic } from "@kinotic-ai/core";
|
|
352
|
-
import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
154
|
+
import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
|
|
353
155
|
interface IVmNodeService extends ICrudServiceProxy<VmNode> {
|
|
354
156
|
/**
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* @param
|
|
358
|
-
* @param
|
|
359
|
-
* @return a Promise resolving to a
|
|
157
|
+
* Lists what happened to the node, newest first: each change of what it should be and of what it
|
|
158
|
+
* reports, and each mark set beside them, with what caused it.
|
|
159
|
+
* @param nodeId the id of the node
|
|
160
|
+
* @param pageable the page to return
|
|
161
|
+
* @return a Promise resolving to a page of ledger entries, empty when the node is not registered
|
|
360
162
|
*/
|
|
361
|
-
|
|
163
|
+
findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
|
|
362
164
|
/**
|
|
363
165
|
* This operation makes all the recent writes immediately available for search.
|
|
364
166
|
* @return a Promise that resolves when the operation is complete
|
|
@@ -367,10 +169,12 @@ interface IVmNodeService extends ICrudServiceProxy<VmNode> {
|
|
|
367
169
|
}
|
|
368
170
|
declare class VmNodeServiceProxy extends CrudServiceProxy<VmNode> implements IVmNodeService {
|
|
369
171
|
constructor(kinotic: IKinotic);
|
|
370
|
-
|
|
172
|
+
findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
|
|
173
|
+
findHistorySinglePage(nodeId: string, pageable: Pageable): Promise<Page<WatchEvent>>;
|
|
371
174
|
syncIndex(): Promise<void>;
|
|
372
175
|
}
|
|
373
|
-
import {
|
|
176
|
+
import { Workload, WatchEvent as WatchEvent2 } from "@kinotic-ai/management-api";
|
|
177
|
+
import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage as IterablePage2, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
|
|
374
178
|
interface IWorkloadService extends ICrudServiceProxy2<Workload> {
|
|
375
179
|
/**
|
|
376
180
|
* Finds all workloads deployed on the given node.
|
|
@@ -378,13 +182,15 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
|
|
|
378
182
|
* @param pageable the page to return
|
|
379
183
|
* @return a Promise resolving to a page of workloads
|
|
380
184
|
*/
|
|
381
|
-
findAllForNode(nodeId: string, pageable:
|
|
185
|
+
findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
|
|
382
186
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* @
|
|
187
|
+
* Lists what happened to the workload, newest first: each status its run passed through and each
|
|
188
|
+
* mark set beside it, with what caused it.
|
|
189
|
+
* @param workloadId the workload
|
|
190
|
+
* @param pageable the page to return
|
|
191
|
+
* @return a Promise resolving to a page of ledger entries, empty when the workload does not exist
|
|
386
192
|
*/
|
|
387
|
-
|
|
193
|
+
findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
|
|
388
194
|
/**
|
|
389
195
|
* This operation makes all the recent writes immediately available for search.
|
|
390
196
|
* @return a Promise that resolves when the operation is complete
|
|
@@ -393,11 +199,13 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
|
|
|
393
199
|
}
|
|
394
200
|
declare class WorkloadServiceProxy extends CrudServiceProxy2<Workload> implements IWorkloadService {
|
|
395
201
|
constructor(kinotic: IKinotic2);
|
|
396
|
-
findAllForNode(nodeId: string, pageable:
|
|
397
|
-
findAllForNodeSinglePage(nodeId: string, pageable:
|
|
398
|
-
|
|
202
|
+
findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
|
|
203
|
+
findAllForNodeSinglePage(nodeId: string, pageable: Pageable2): Promise<Page2<Workload>>;
|
|
204
|
+
findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
|
|
205
|
+
findHistorySinglePage(workloadId: string, pageable: Pageable2): Promise<Page2<WatchEvent2>>;
|
|
399
206
|
syncIndex(): Promise<void>;
|
|
400
207
|
}
|
|
208
|
+
import { Workload as Workload2 } from "@kinotic-ai/management-api";
|
|
401
209
|
import { IKinotic as IKinotic3 } from "@kinotic-ai/core";
|
|
402
210
|
/**
|
|
403
211
|
* Orchestrates workload deployment across the cluster, acting as the intermediary between
|
|
@@ -414,15 +222,7 @@ interface IWorkloadOrchestrationService {
|
|
|
414
222
|
* @param workload the workload configuration to deploy
|
|
415
223
|
* @return a Promise resolving to the deployed workload (including assigned nodeId and id)
|
|
416
224
|
*/
|
|
417
|
-
deployWorkload(workload:
|
|
418
|
-
/**
|
|
419
|
-
* Restarts a stopped workload in place on the node it is deployed to. Fails unless the
|
|
420
|
-
* workload is stopped; a workload stopped with autoRemove true has no VM left to restart.
|
|
421
|
-
* Honors the workload's detached flag the same way as {@link deployWorkload}.
|
|
422
|
-
* @param workloadId the id of the workload to restart
|
|
423
|
-
* @return a Promise resolving to the restarted workload
|
|
424
|
-
*/
|
|
425
|
-
restartWorkload(workloadId: string): Promise<Workload>;
|
|
225
|
+
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
426
226
|
/**
|
|
427
227
|
* Stops a running workload.
|
|
428
228
|
* @param workloadId the id of the workload to stop
|
|
@@ -430,19 +230,40 @@ interface IWorkloadOrchestrationService {
|
|
|
430
230
|
*/
|
|
431
231
|
stopWorkload(workloadId: string): Promise<void>;
|
|
432
232
|
/**
|
|
433
|
-
* Destroys a workload
|
|
233
|
+
* Destroys a workload's VM on its node, with its disk, and returns its room. A run still open is
|
|
234
|
+
* recorded STOPPED. The record stays as the run's outcome, and its logs stay in the log store,
|
|
235
|
+
* until deleteWorkload.
|
|
434
236
|
* @param workloadId the id of the workload to destroy
|
|
435
|
-
* @return a Promise that resolves when the
|
|
237
|
+
* @return a Promise that resolves when the VM has been destroyed
|
|
436
238
|
*/
|
|
437
239
|
destroyWorkload(workloadId: string): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Deletes a workload's record and every log line it wrote from the organization's log store, the
|
|
242
|
+
* one way either is removed. A run still open on its node — starting, running, or a stop the node
|
|
243
|
+
* has not answered — is refused: stop or destroy it first.
|
|
244
|
+
* @param workloadId the id of the workload to delete
|
|
245
|
+
* @return a Promise that resolves when the record and its logs are gone, or rejects if the run is
|
|
246
|
+
* still open
|
|
247
|
+
*/
|
|
248
|
+
deleteWorkload(workloadId: string): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Deletes the given workloads' records and every log line they wrote, as deleteWorkload does for
|
|
251
|
+
* one, with the log store asked once per organization. Any run still open refuses the whole batch
|
|
252
|
+
* before anything is deleted.
|
|
253
|
+
* @param workloadIds the ids of the workloads to delete
|
|
254
|
+
* @return a Promise that resolves when the records and their logs are gone, or rejects if any run
|
|
255
|
+
* is still open
|
|
256
|
+
*/
|
|
257
|
+
deleteWorkloads(workloadIds: string[]): Promise<void>;
|
|
438
258
|
}
|
|
439
259
|
declare class WorkloadOrchestrationService implements IWorkloadOrchestrationService {
|
|
440
260
|
private readonly serviceProxy;
|
|
441
261
|
constructor(kinotic: IKinotic3);
|
|
442
|
-
deployWorkload(workload:
|
|
443
|
-
restartWorkload(workloadId: string): Promise<Workload>;
|
|
262
|
+
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
444
263
|
stopWorkload(workloadId: string): Promise<void>;
|
|
445
264
|
destroyWorkload(workloadId: string): Promise<void>;
|
|
265
|
+
deleteWorkload(workloadId: string): Promise<void>;
|
|
266
|
+
deleteWorkloads(workloadIds: string[]): Promise<void>;
|
|
446
267
|
}
|
|
447
268
|
import { IKinotic as IKinotic4 } from "@kinotic-ai/core";
|
|
448
269
|
/**
|
|
@@ -507,6 +328,22 @@ declare class LoggersDescriptor {
|
|
|
507
328
|
groups: Map<string, GroupLoggerLevelsDescriptor>;
|
|
508
329
|
}
|
|
509
330
|
/**
|
|
331
|
+
* The CRI patterns that decide what trace logging prints.
|
|
332
|
+
*
|
|
333
|
+
* Each pattern is matched against the fully qualified CRI with Ant wildcards, where `*` matches
|
|
334
|
+
* within one segment and `**` across segments, so
|
|
335
|
+
* `srv://system-api~com.acme.HeartbeatService/*` covers every method of that service and
|
|
336
|
+
* `srv://system-api~com.acme.HeartbeatService/ping` covers only that one.
|
|
337
|
+
* An include wins over an exclude, so `excludes: ['**']` plus the handful of includes worth
|
|
338
|
+
* watching narrows trace logging to those services alone.
|
|
339
|
+
*/
|
|
340
|
+
declare class TraceLogProperties {
|
|
341
|
+
/** CRIs kept in trace logging whatever the excludes say. Empty leaves the excludes to decide. */
|
|
342
|
+
includes: string[];
|
|
343
|
+
/** CRIs left out of trace logging, request and reply both, unless an include covers them. */
|
|
344
|
+
excludes: string[];
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
510
347
|
* Provides the ability to manage loggers
|
|
511
348
|
*/
|
|
512
349
|
interface ILogManager {
|
|
@@ -528,24 +365,46 @@ interface ILogManager {
|
|
|
528
365
|
* @param level the {@link LogLevel} to set for the logger with the given name
|
|
529
366
|
*/
|
|
530
367
|
configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
|
|
368
|
+
/**
|
|
369
|
+
* @param nodeId the kinotic node to get the trace log patterns from
|
|
370
|
+
* @return the CRI patterns currently deciding what the node trace logs
|
|
371
|
+
*/
|
|
372
|
+
traceLog(nodeId: string): Promise<TraceLogProperties>;
|
|
373
|
+
/**
|
|
374
|
+
* Configures the CRI patterns deciding what the node trace logs, silencing a service that
|
|
375
|
+
* would otherwise bury the log while trace logging is on.
|
|
376
|
+
* The patterns replace whatever the node is using and last until it restarts, which returns it
|
|
377
|
+
* to the `kinotic.traceLog` it was configured with.
|
|
378
|
+
*
|
|
379
|
+
* @param nodeId the kinotic node to set the trace log patterns on
|
|
380
|
+
* @param traceLog the include and exclude patterns to apply
|
|
381
|
+
*/
|
|
382
|
+
configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
|
|
531
383
|
}
|
|
532
384
|
import { IKinotic as IKinotic5 } from "@kinotic-ai/core";
|
|
533
385
|
/**
|
|
534
|
-
* A single
|
|
535
|
-
* {@code org.kinotic.
|
|
386
|
+
* A single server node in the cluster, of the org, system or app server. Mirrors the server's
|
|
387
|
+
* {@code org.kinotic.system.api.model.cluster.KinoticNodeInfo}.
|
|
536
388
|
*/
|
|
537
389
|
declare class KinoticNodeInfo {
|
|
538
390
|
nodeId: string;
|
|
539
391
|
order: number;
|
|
540
|
-
|
|
541
|
-
|
|
392
|
+
/** The server kind the node runs, such as management, system or app. */
|
|
393
|
+
serverName: string;
|
|
394
|
+
addresses: string[];
|
|
395
|
+
hostNames: string[];
|
|
396
|
+
/** The Kinotic version the node runs; null when the node runs from classes rather than a packaged jar. */
|
|
397
|
+
version: string | null;
|
|
398
|
+
/** The service name that labels the logs of the server the node runs, for LogService's server log methods; null when the deployment configures none. */
|
|
399
|
+
telemetryServiceName: string | null;
|
|
400
|
+
/** The service instance id that labels the node's own logs, narrowing a server log query to this node; null when the deployment configures none. */
|
|
401
|
+
telemetryServiceInstanceId: string | null;
|
|
542
402
|
}
|
|
543
403
|
/**
|
|
544
|
-
* The
|
|
545
|
-
* {@code org.kinotic.
|
|
404
|
+
* The current topology and state of the cluster the org, system and app servers form. Mirrors the
|
|
405
|
+
* server's {@code org.kinotic.system.api.model.cluster.KinoticClusterInfo}.
|
|
546
406
|
*/
|
|
547
407
|
declare class KinoticClusterInfo {
|
|
548
|
-
localNodeId: string;
|
|
549
408
|
serverNodeCount: number;
|
|
550
409
|
topologyVersion: number;
|
|
551
410
|
clusterState: string;
|
|
@@ -553,7 +412,7 @@ declare class KinoticClusterInfo {
|
|
|
553
412
|
active: boolean;
|
|
554
413
|
}
|
|
555
414
|
/**
|
|
556
|
-
* Queries the
|
|
415
|
+
* Queries the topology and state of the cluster the org, system and app servers form.
|
|
557
416
|
*/
|
|
558
417
|
interface IKinoticClusterInfoService {
|
|
559
418
|
/**
|
|
@@ -567,37 +426,84 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
|
|
|
567
426
|
getClusterInfo(): Promise<KinoticClusterInfo>;
|
|
568
427
|
}
|
|
569
428
|
import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
|
|
570
|
-
import { IKinotic as IKinotic6, Page as
|
|
429
|
+
import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
|
|
571
430
|
/**
|
|
572
431
|
* Cross-organization reads for platform operators. Published in the system zone, which only
|
|
573
432
|
* SYSTEM participants may address, so every method takes the target organization explicitly
|
|
574
433
|
* instead of resolving it from the caller's scope.
|
|
575
434
|
*/
|
|
576
435
|
interface ISystemOrganizationService {
|
|
577
|
-
findOrganizations(pageable:
|
|
578
|
-
searchOrganizations(searchText: string, pageable:
|
|
436
|
+
findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
|
|
437
|
+
searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
|
|
579
438
|
/** Resolves null when no organization has the given id. */
|
|
580
439
|
findOrganizationById(organizationId: string): Promise<Organization | null>;
|
|
581
440
|
countOrganizations(): Promise<number>;
|
|
582
|
-
findApplications(organizationId: string, pageable:
|
|
583
|
-
findProjects(organizationId: string, pageable:
|
|
441
|
+
findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
|
|
442
|
+
findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
|
|
584
443
|
/** applicationId null = the organization's members */
|
|
585
|
-
findMembers(organizationId: string, applicationId: string | null, pageable:
|
|
586
|
-
searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable:
|
|
587
|
-
findPendingInvites(organizationId: string, applicationId: string | null, pageable:
|
|
444
|
+
findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
|
|
445
|
+
searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
|
|
446
|
+
findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
|
|
588
447
|
}
|
|
589
448
|
declare class SystemOrganizationService implements ISystemOrganizationService {
|
|
590
449
|
private readonly serviceProxy;
|
|
591
450
|
constructor(kinotic: IKinotic6);
|
|
592
|
-
findOrganizations(pageable:
|
|
593
|
-
searchOrganizations(searchText: string, pageable:
|
|
451
|
+
findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
|
|
452
|
+
searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
|
|
594
453
|
findOrganizationById(organizationId: string): Promise<Organization | null>;
|
|
595
454
|
countOrganizations(): Promise<number>;
|
|
596
|
-
findApplications(organizationId: string, pageable:
|
|
597
|
-
findProjects(organizationId: string, pageable:
|
|
598
|
-
findMembers(organizationId: string, applicationId: string | null, pageable:
|
|
599
|
-
searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable:
|
|
600
|
-
findPendingInvites(organizationId: string, applicationId: string | null, pageable:
|
|
455
|
+
findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
|
|
456
|
+
findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
|
|
457
|
+
findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
|
|
458
|
+
searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
|
|
459
|
+
findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
|
|
460
|
+
}
|
|
461
|
+
import { MachineParticipantIdentity, MachineProvisionResult, UserParticipantIdentity as UserParticipantIdentity2 } from "@kinotic-ai/management-api";
|
|
462
|
+
import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
|
|
463
|
+
/**
|
|
464
|
+
* The platform's own members: the operators who sign in to the system console, and the
|
|
465
|
+
* SYSTEM-scope machines that connect as platform daemons, such as a worker node's vm-manager.
|
|
466
|
+
* Published in the system zone, which only SYSTEM participants may address; every method works
|
|
467
|
+
* on SYSTEM scope alone, so an organization's users and machines stay that organization's to
|
|
468
|
+
* manage through IMachineService.
|
|
469
|
+
*/
|
|
470
|
+
interface ISystemMemberService {
|
|
471
|
+
findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
|
|
472
|
+
searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
|
|
473
|
+
/** Lists the platform's machines, disabled ones included. */
|
|
474
|
+
findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
|
|
475
|
+
/**
|
|
476
|
+
* Provisions a platform machine and returns it together with its generated client secret.
|
|
477
|
+
* The secret is disclosed exactly once — it cannot be retrieved later.
|
|
478
|
+
*/
|
|
479
|
+
createMachine(displayName: string): Promise<MachineProvisionResult>;
|
|
480
|
+
/**
|
|
481
|
+
* Replaces a platform machine's client secret, returning the new secret exactly once. The
|
|
482
|
+
* old secret stops working immediately; a connection the machine already holds lasts until
|
|
483
|
+
* it disconnects.
|
|
484
|
+
*/
|
|
485
|
+
rotateSecret(machineId: string): Promise<string>;
|
|
486
|
+
/**
|
|
487
|
+
* Enables or disables a platform machine. A disabled machine is cut off on its next
|
|
488
|
+
* connection, and enabling it restores access with the same credential.
|
|
489
|
+
*/
|
|
490
|
+
setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
|
|
491
|
+
/**
|
|
492
|
+
* Permanently removes a platform machine, including its stored credential. A removed
|
|
493
|
+
* machine's id cannot authenticate again.
|
|
494
|
+
*/
|
|
495
|
+
removeMachine(machineId: string): Promise<void>;
|
|
496
|
+
}
|
|
497
|
+
declare class SystemMemberService implements ISystemMemberService {
|
|
498
|
+
private readonly serviceProxy;
|
|
499
|
+
constructor(kinotic: IKinotic7);
|
|
500
|
+
findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
|
|
501
|
+
searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
|
|
502
|
+
findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
|
|
503
|
+
createMachine(displayName: string): Promise<MachineProvisionResult>;
|
|
504
|
+
rotateSecret(machineId: string): Promise<string>;
|
|
505
|
+
setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
|
|
506
|
+
removeMachine(machineId: string): Promise<void>;
|
|
601
507
|
}
|
|
602
508
|
interface ISystemApiExtension {
|
|
603
509
|
vmNodes: IVmNodeService;
|
|
@@ -606,17 +512,20 @@ interface ISystemApiExtension {
|
|
|
606
512
|
logManager: ILogManager;
|
|
607
513
|
clusterInfo: IKinoticClusterInfoService;
|
|
608
514
|
systemOrganizations: ISystemOrganizationService;
|
|
515
|
+
systemMembers: ISystemMemberService;
|
|
609
516
|
}
|
|
610
517
|
declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
|
|
611
|
-
import { IKinotic as
|
|
518
|
+
import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
|
|
612
519
|
declare class LogManager implements ILogManager {
|
|
613
520
|
private readonly serviceProxy;
|
|
614
|
-
constructor(kinotic:
|
|
521
|
+
constructor(kinotic: IKinotic8);
|
|
615
522
|
loggers(nodeId: string): Promise<LoggersDescriptor>;
|
|
616
523
|
loggerLevels(nodeId: string, name: string): Promise<LoggerLevelsDescriptor>;
|
|
617
524
|
configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
|
|
525
|
+
traceLog(nodeId: string): Promise<TraceLogProperties>;
|
|
526
|
+
configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
|
|
618
527
|
}
|
|
619
528
|
declare module "@kinotic-ai/core" {
|
|
620
529
|
interface KinoticSingleton extends ISystemApiExtension {}
|
|
621
530
|
}
|
|
622
|
-
export { WorkloadStatusReport,
|
|
531
|
+
export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
|