@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 CHANGED
@@ -40,27 +40,22 @@ var __export = (target, all) => {
40
40
  // packages/system-api/src/index.ts
41
41
  var exports_src = {};
42
42
  __export(exports_src, {
43
- WorkloadStatus: () => WorkloadStatus,
44
43
  WorkloadServiceProxy: () => WorkloadServiceProxy,
45
44
  WorkloadOrchestrationService: () => WorkloadOrchestrationService,
46
- Workload: () => Workload,
47
45
  VmProviderType: () => VmProviderType,
48
46
  VmNodeStatusType: () => VmNodeStatusType,
49
- VmNodeStatus: () => VmNodeStatus,
50
47
  VmNodeServiceProxy: () => VmNodeServiceProxy,
51
48
  VmNodeRegistration: () => VmNodeRegistration,
52
49
  VmNodeOrchestrationServiceProxy: () => VmNodeOrchestrationServiceProxy,
53
50
  VmNode: () => VmNode,
51
+ TraceLogProperties: () => TraceLogProperties,
54
52
  SystemOrganizationService: () => SystemOrganizationService,
53
+ SystemMemberService: () => SystemMemberService,
55
54
  SystemApiPlugin: () => SystemApiPlugin,
56
55
  SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
57
- SYSTEM_API_ZONE: () => import_management_api8.SYSTEM_API_ZONE,
58
- PortProtocol: () => PortProtocol,
59
- NetworkPolicy: () => NetworkPolicy,
60
- NetworkMode: () => NetworkMode,
56
+ SYSTEM_API_ZONE: () => import_management_api9.SYSTEM_API_ZONE,
61
57
  LoggersDescriptor: () => LoggersDescriptor,
62
58
  LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
63
- LogPolicy: () => LogPolicy,
64
59
  LogManager: () => LogManager,
65
60
  LogLevel: () => LogLevel,
66
61
  KinoticNodeInfo: () => KinoticNodeInfo,
@@ -69,43 +64,10 @@ __export(exports_src, {
69
64
  GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor
70
65
  });
71
66
  module.exports = __toCommonJS(exports_src);
72
- var import_management_api8 = require("@kinotic-ai/management-api");
73
-
74
- // packages/system-api/src/api/model/workload/LogPolicy.ts
75
- class LogPolicy {
76
- maxSizeMb = 10;
77
- maxFiles = 3;
78
- }
79
- // packages/system-api/src/api/model/workload/NetworkMode.ts
80
- var NetworkMode;
81
- ((NetworkMode2) => {
82
- NetworkMode2["ENABLED"] = "ENABLED";
83
- NetworkMode2["DISABLED"] = "DISABLED";
84
- })(NetworkMode ||= {});
85
- // packages/system-api/src/api/model/workload/NetworkPolicy.ts
86
- class NetworkPolicy {
87
- mode = "ENABLED" /* ENABLED */;
88
- allowedHosts = [];
89
- }
90
- // packages/system-api/src/api/model/workload/PortProtocol.ts
91
- var PortProtocol;
92
- ((PortProtocol2) => {
93
- PortProtocol2["TCP"] = "TCP";
94
- PortProtocol2["UDP"] = "UDP";
95
- })(PortProtocol ||= {});
96
- // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
97
- var VmNodeStatusType;
98
- ((VmNodeStatusType2) => {
99
- VmNodeStatusType2["ONLINE"] = "ONLINE";
100
- VmNodeStatusType2["OFFLINE"] = "OFFLINE";
101
- VmNodeStatusType2["DRAINING"] = "DRAINING";
102
- })(VmNodeStatusType ||= {});
67
+ var import_management_api9 = require("@kinotic-ai/management-api");
103
68
 
104
- // packages/system-api/src/api/model/workload/VmNodeStatus.ts
105
- class VmNodeStatus {
106
- type = "ONLINE" /* ONLINE */;
107
- healthMessage = null;
108
- }
69
+ // packages/system-api/src/api/model/workload/VmNode.ts
70
+ var import_management_api = require("@kinotic-ai/management-api");
109
71
 
110
72
  // packages/system-api/src/api/model/workload/VmProviderType.ts
111
73
  var VmProviderType;
@@ -119,14 +81,15 @@ class VmNode {
119
81
  id;
120
82
  name;
121
83
  hostname;
122
- status = new VmNodeStatus;
84
+ state = new import_management_api.ReconcileState;
85
+ healthMessage = null;
123
86
  providerType = "BOXLITE" /* BOXLITE */;
124
87
  totalCpus = 0;
125
88
  totalMemoryMb = 0;
126
89
  totalDiskMb = 0;
127
- allocatedCpus = 0;
128
- allocatedMemoryMb = 0;
129
- allocatedDiskMb = 0;
90
+ freeCpus = 0;
91
+ freeMemoryMb = 0;
92
+ freeDiskMb = 0;
130
93
  lastSeen = null;
131
94
  workloadDataDir = null;
132
95
  constructor(id, name, hostname) {
@@ -135,49 +98,13 @@ class VmNode {
135
98
  this.hostname = hostname;
136
99
  }
137
100
  }
138
- // packages/system-api/src/api/model/workload/WorkloadStatus.ts
139
- var WorkloadStatus;
140
- ((WorkloadStatus2) => {
141
- WorkloadStatus2["PENDING"] = "PENDING";
142
- WorkloadStatus2["STARTING"] = "STARTING";
143
- WorkloadStatus2["RUNNING"] = "RUNNING";
144
- WorkloadStatus2["STOPPING"] = "STOPPING";
145
- WorkloadStatus2["STOPPED"] = "STOPPED";
146
- WorkloadStatus2["FAILED"] = "FAILED";
147
- })(WorkloadStatus ||= {});
148
-
149
- // packages/system-api/src/api/model/workload/Workload.ts
150
- class Workload {
151
- id = null;
152
- name;
153
- description;
154
- nodeId = null;
155
- organizationId = null;
156
- applicationId = null;
157
- image;
158
- vcpus = 1;
159
- memoryMb = 512;
160
- diskSizeMb = 1024;
161
- network = new NetworkPolicy;
162
- logPolicy = new LogPolicy;
163
- detached = true;
164
- autoRemove = false;
165
- status = "PENDING" /* PENDING */;
166
- exitCode = null;
167
- environment = {};
168
- secrets = {};
169
- portMappings = [];
170
- volumeMounts = [];
171
- entrypoint = [];
172
- cmd = [];
173
- created = null;
174
- updated = null;
175
- constructor(name, image) {
176
- this.name = name;
177
- this.image = image;
178
- }
179
- }
180
- // packages/system-api/src/api/model/VmNodeRegistration.ts
101
+ // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
102
+ var VmNodeStatusType;
103
+ ((VmNodeStatusType2) => {
104
+ VmNodeStatusType2["ONLINE"] = "ONLINE";
105
+ VmNodeStatusType2["DRAINING"] = "DRAINING";
106
+ })(VmNodeStatusType ||= {});
107
+ // packages/system-api/src/api/model/workload/VmNodeRegistration.ts
181
108
  class VmNodeRegistration {
182
109
  id;
183
110
  name;
@@ -193,28 +120,32 @@ class VmNodeRegistration {
193
120
  this.hostname = hostname;
194
121
  }
195
122
  }
196
- // packages/system-api/src/api/services/IVmNodeService.ts
197
- var import_management_api = require("@kinotic-ai/management-api");
123
+ // packages/system-api/src/api/services/workload/IVmNodeService.ts
124
+ var import_management_api2 = require("@kinotic-ai/management-api");
198
125
  var import_core = require("@kinotic-ai/core");
199
126
 
200
127
  class VmNodeServiceProxy extends import_core.CrudServiceProxy {
201
128
  constructor(kinotic) {
202
- super(kinotic.serviceProxy(`${import_management_api.SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeService`));
129
+ super(kinotic.serviceProxy(`${import_management_api2.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeService`));
203
130
  }
204
- findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
205
- return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
131
+ async findHistory(nodeId, pageable) {
132
+ const page = await this.findHistorySinglePage(nodeId, pageable);
133
+ return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(nodeId, pageable2));
134
+ }
135
+ findHistorySinglePage(nodeId, pageable) {
136
+ return this.serviceProxy.invoke("findHistory", [nodeId, pageable]);
206
137
  }
207
138
  syncIndex() {
208
139
  return this.serviceProxy.invoke("syncIndex", []);
209
140
  }
210
141
  }
211
- // packages/system-api/src/api/services/IWorkloadService.ts
212
- var import_management_api2 = require("@kinotic-ai/management-api");
142
+ // packages/system-api/src/api/services/workload/IWorkloadService.ts
143
+ var import_management_api3 = require("@kinotic-ai/management-api");
213
144
  var import_core2 = require("@kinotic-ai/core");
214
145
 
215
146
  class WorkloadServiceProxy extends import_core2.CrudServiceProxy {
216
147
  constructor(kinotic) {
217
- super(kinotic.serviceProxy(`${import_management_api2.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WorkloadService`));
148
+ super(kinotic.serviceProxy(`${import_management_api3.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.WorkloadService`));
218
149
  }
219
150
  async findAllForNode(nodeId, pageable) {
220
151
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
@@ -223,41 +154,48 @@ class WorkloadServiceProxy extends import_core2.CrudServiceProxy {
223
154
  findAllForNodeSinglePage(nodeId, pageable) {
224
155
  return this.serviceProxy.invoke("findAllForNode", [nodeId, pageable]);
225
156
  }
226
- countForNode(nodeId) {
227
- return this.serviceProxy.invoke("countForNode", [nodeId]);
157
+ async findHistory(workloadId, pageable) {
158
+ const page = await this.findHistorySinglePage(workloadId, pageable);
159
+ return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(workloadId, pageable2));
160
+ }
161
+ findHistorySinglePage(workloadId, pageable) {
162
+ return this.serviceProxy.invoke("findHistory", [workloadId, pageable]);
228
163
  }
229
164
  syncIndex() {
230
165
  return this.serviceProxy.invoke("syncIndex", []);
231
166
  }
232
167
  }
233
- // packages/system-api/src/api/services/IWorkloadOrchestrationService.ts
234
- var import_management_api3 = require("@kinotic-ai/management-api");
168
+ // packages/system-api/src/api/services/workload/IWorkloadOrchestrationService.ts
169
+ var import_management_api4 = require("@kinotic-ai/management-api");
235
170
 
236
171
  class WorkloadOrchestrationService {
237
172
  serviceProxy;
238
173
  constructor(kinotic) {
239
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api3.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WorkloadOrchestrationService`);
174
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api4.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.WorkloadOrchestrationService`);
240
175
  }
241
176
  deployWorkload(workload) {
242
177
  return this.serviceProxy.invoke("deployWorkload", [workload]);
243
178
  }
244
- restartWorkload(workloadId) {
245
- return this.serviceProxy.invoke("restartWorkload", [workloadId]);
246
- }
247
179
  stopWorkload(workloadId) {
248
180
  return this.serviceProxy.invoke("stopWorkload", [workloadId]);
249
181
  }
250
182
  destroyWorkload(workloadId) {
251
183
  return this.serviceProxy.invoke("destroyWorkload", [workloadId]);
252
184
  }
185
+ deleteWorkload(workloadId) {
186
+ return this.serviceProxy.invoke("deleteWorkload", [workloadId]);
187
+ }
188
+ deleteWorkloads(workloadIds) {
189
+ return this.serviceProxy.invoke("deleteWorkloads", [workloadIds]);
190
+ }
253
191
  }
254
- // packages/system-api/src/api/services/VmNodeOrchestrationServiceProxy.ts
255
- var import_management_api4 = require("@kinotic-ai/management-api");
192
+ // packages/system-api/src/api/services/workload/VmNodeOrchestrationServiceProxy.ts
193
+ var import_management_api5 = require("@kinotic-ai/management-api");
256
194
 
257
195
  class VmNodeOrchestrationServiceProxy {
258
196
  serviceProxy;
259
197
  constructor(kinotic) {
260
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api4.SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeOrchestrationService`);
198
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api5.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeOrchestrationService`);
261
199
  }
262
200
  registerNode(registration) {
263
201
  return this.serviceProxy.invoke("registerNode", [registration]);
@@ -272,9 +210,6 @@ class VmNodeOrchestrationServiceProxy {
272
210
  return this.serviceProxy.invoke("deregisterNode", [nodeId]);
273
211
  }
274
212
  }
275
- // packages/system-api/src/api/services/LogManager.ts
276
- var import_management_api5 = require("@kinotic-ai/management-api");
277
-
278
213
  // packages/system-api/src/api/services/ILogManager.ts
279
214
  var LogLevel;
280
215
  ((LogLevel2) => {
@@ -305,11 +240,16 @@ class LoggersDescriptor {
305
240
  groups = new Map;
306
241
  }
307
242
 
243
+ class TraceLogProperties {
244
+ includes = [];
245
+ excludes = [];
246
+ }
247
+
308
248
  // packages/system-api/src/api/services/LogManager.ts
309
249
  class LogManager {
310
250
  serviceProxy;
311
251
  constructor(kinotic) {
312
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api5.SYSTEM_API_ZONE}~org.kinotic.system.api.services.LogManager`);
252
+ this.serviceProxy = kinotic.serviceProxy("org.kinotic.core.api.log.LogManager");
313
253
  }
314
254
  loggers(nodeId) {
315
255
  return this.serviceProxy.invoke("loggers", null, nodeId);
@@ -330,6 +270,15 @@ class LogManager {
330
270
  configureLogLevel(nodeId, name, level) {
331
271
  return this.serviceProxy.invoke("configureLogLevel", [name, level], nodeId);
332
272
  }
273
+ async traceLog(nodeId) {
274
+ const data = await this.serviceProxy.invoke("traceLog", null, nodeId);
275
+ const ret = new TraceLogProperties;
276
+ Object.assign(ret, data);
277
+ return ret;
278
+ }
279
+ configureTraceLog(nodeId, traceLog) {
280
+ return this.serviceProxy.invoke("configureTraceLog", [traceLog], nodeId);
281
+ }
333
282
  }
334
283
 
335
284
  // packages/system-api/src/api/services/IKinoticClusterInfoService.ts
@@ -382,6 +331,37 @@ class SystemOrganizationService {
382
331
  }
383
332
  }
384
333
 
334
+ // packages/system-api/src/api/services/ISystemMemberService.ts
335
+ var import_management_api8 = require("@kinotic-ai/management-api");
336
+
337
+ class SystemMemberService {
338
+ serviceProxy;
339
+ constructor(kinotic) {
340
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api8.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemMemberService`);
341
+ }
342
+ findUsers(pageable) {
343
+ return this.serviceProxy.invoke("findUsers", [pageable]);
344
+ }
345
+ searchUsers(searchText, pageable) {
346
+ return this.serviceProxy.invoke("searchUsers", [searchText, pageable]);
347
+ }
348
+ findMachines(pageable) {
349
+ return this.serviceProxy.invoke("findMachines", [pageable]);
350
+ }
351
+ createMachine(displayName) {
352
+ return this.serviceProxy.invoke("createMachine", [displayName]);
353
+ }
354
+ rotateSecret(machineId) {
355
+ return this.serviceProxy.invoke("rotateSecret", [machineId]);
356
+ }
357
+ setMachineEnabled(machineId, enabled) {
358
+ return this.serviceProxy.invoke("setMachineEnabled", [machineId, enabled]);
359
+ }
360
+ removeMachine(machineId) {
361
+ return this.serviceProxy.invoke("removeMachine", [machineId]);
362
+ }
363
+ }
364
+
385
365
  // packages/system-api/src/api/SystemApiPlugin.ts
386
366
  var SystemApiPlugin = {
387
367
  install(kinotic) {
@@ -391,23 +371,27 @@ var SystemApiPlugin = {
391
371
  workloadOrchestration: new WorkloadOrchestrationService(kinotic),
392
372
  logManager: new LogManager(kinotic),
393
373
  clusterInfo: new KinoticClusterInfoService(kinotic),
394
- systemOrganizations: new SystemOrganizationService(kinotic)
374
+ systemOrganizations: new SystemOrganizationService(kinotic),
375
+ systemMembers: new SystemMemberService(kinotic)
395
376
  };
396
377
  }
397
378
  };
398
- // packages/system-api/src/api/model/KinoticClusterInfo.ts
379
+ // packages/system-api/src/api/model/cluster/KinoticClusterInfo.ts
399
380
  class KinoticClusterInfo {
400
- localNodeId = "";
401
381
  serverNodeCount = 0;
402
382
  topologyVersion = 0;
403
383
  clusterState = "";
404
384
  nodes = [];
405
385
  active = false;
406
386
  }
407
- // packages/system-api/src/api/model/KinoticNodeInfo.ts
387
+ // packages/system-api/src/api/model/cluster/KinoticNodeInfo.ts
408
388
  class KinoticNodeInfo {
409
389
  nodeId = "";
410
390
  order = 0;
411
- local = false;
412
- version = "";
391
+ serverName = "";
392
+ addresses = [];
393
+ hostNames = [];
394
+ version = null;
395
+ telemetryServiceName = null;
396
+ telemetryServiceInstanceId = null;
413
397
  }