kurtosis-sdk 0.49.5

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.
Files changed (69) hide show
  1. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_grpc_pb.d.ts +110 -0
  2. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_grpc_pb.js +581 -0
  3. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_grpc_web_pb.d.ts +236 -0
  4. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_grpc_web_pb.js +1174 -0
  5. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_pb.d.ts +918 -0
  6. package/build/core/kurtosis_core_rpc_api_bindings/api_container_service_pb.js +7616 -0
  7. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_grpc_pb.d.ts +30 -0
  8. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_grpc_pb.js +70 -0
  9. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_grpc_web_pb.d.ts +44 -0
  10. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_grpc_web_pb.js +198 -0
  11. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_pb.d.ts +41 -0
  12. package/build/core/kurtosis_core_rpc_api_bindings/executable_module_service_pb.js +324 -0
  13. package/build/core/lib/constructor_calls.d.ts +33 -0
  14. package/build/core/lib/constructor_calls.js +328 -0
  15. package/build/core/lib/enclaves/enclave_context.d.ts +39 -0
  16. package/build/core/lib/enclaves/enclave_context.js +501 -0
  17. package/build/core/lib/enclaves/generic_api_container_client.d.ts +23 -0
  18. package/build/core/lib/enclaves/generic_api_container_client.js +6 -0
  19. package/build/core/lib/enclaves/generic_path_joiner.d.ts +3 -0
  20. package/build/core/lib/enclaves/generic_path_joiner.js +6 -0
  21. package/build/core/lib/enclaves/generic_tgz_archiver.d.ts +4 -0
  22. package/build/core/lib/enclaves/generic_tgz_archiver.js +2 -0
  23. package/build/core/lib/enclaves/grpc_node_api_container_client.d.ts +29 -0
  24. package/build/core/lib/enclaves/grpc_node_api_container_client.js +415 -0
  25. package/build/core/lib/enclaves/grpc_web_api_container_client.d.ts +28 -0
  26. package/build/core/lib/enclaves/grpc_web_api_container_client.js +415 -0
  27. package/build/core/lib/enclaves/node_tgz_archiver.d.ts +6 -0
  28. package/build/core/lib/enclaves/node_tgz_archiver.js +94 -0
  29. package/build/core/lib/enclaves/partition_connection.d.ts +20 -0
  30. package/build/core/lib/enclaves/partition_connection.js +62 -0
  31. package/build/core/lib/enclaves/template_and_data.d.ts +5 -0
  32. package/build/core/lib/enclaves/template_and_data.js +11 -0
  33. package/build/core/lib/enclaves/web_tgz_archiver.d.ts +5 -0
  34. package/build/core/lib/enclaves/web_tgz_archiver.js +26 -0
  35. package/build/core/lib/modules/module_context.d.ts +9 -0
  36. package/build/core/lib/modules/module_context.js +34 -0
  37. package/build/core/lib/services/container_config.d.ts +39 -0
  38. package/build/core/lib/services/container_config.js +85 -0
  39. package/build/core/lib/services/port_spec.d.ts +11 -0
  40. package/build/core/lib/services/port_spec.js +16 -0
  41. package/build/core/lib/services/service.d.ts +1 -0
  42. package/build/core/lib/services/service.js +6 -0
  43. package/build/core/lib/services/service_context.d.ts +19 -0
  44. package/build/core/lib/services/service_context.js +58 -0
  45. package/build/core/module_launch_api/args_io.d.ts +4 -0
  46. package/build/core/module_launch_api/args_io.js +60 -0
  47. package/build/core/module_launch_api/module_container_args.d.ts +8 -0
  48. package/build/core/module_launch_api/module_container_args.js +24 -0
  49. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_grpc_pb.d.ts +50 -0
  50. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_grpc_pb.js +186 -0
  51. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_grpc_web_pb.d.ts +92 -0
  52. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_grpc_web_pb.js +442 -0
  53. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_pb.d.ts +267 -0
  54. package/build/engine/kurtosis_engine_rpc_api_bindings/engine_service_pb.js +2141 -0
  55. package/build/engine/lib/constructor_calls.d.ts +5 -0
  56. package/build/engine/lib/constructor_calls.js +34 -0
  57. package/build/engine/lib/kurtosis_context/generic_engine_client.d.ts +10 -0
  58. package/build/engine/lib/kurtosis_context/generic_engine_client.js +2 -0
  59. package/build/engine/lib/kurtosis_context/grpc_node_engine_client.d.ts +14 -0
  60. package/build/engine/lib/kurtosis_context/grpc_node_engine_client.js +165 -0
  61. package/build/engine/lib/kurtosis_context/grpc_web_engine_client.d.ts +14 -0
  62. package/build/engine/lib/kurtosis_context/grpc_web_engine_client.js +165 -0
  63. package/build/engine/lib/kurtosis_context/kurtosis_context.d.ts +19 -0
  64. package/build/engine/lib/kurtosis_context/kurtosis_context.js +236 -0
  65. package/build/index.d.ts +19 -0
  66. package/build/index.js +55 -0
  67. package/build/kurtosis_version/kurtosis_version.d.ts +1 -0
  68. package/build/kurtosis_version/kurtosis_version.js +8 -0
  69. package/package.json +59 -0
@@ -0,0 +1,39 @@
1
+ import { Result } from "neverthrow";
2
+ import { ModuleContext, ModuleID } from "../modules/module_context";
3
+ import type { ContainerConfig, FilesArtifactUUID } from "../services/container_config";
4
+ import type { ServiceID } from "../services/service";
5
+ import { ServiceContext } from "../services/service_context";
6
+ import type { PartitionConnection } from "./partition_connection";
7
+ import { TemplateAndData } from "./template_and_data";
8
+ export declare type EnclaveID = string;
9
+ export declare type PartitionID = string;
10
+ export declare class EnclaveContext {
11
+ private readonly backend;
12
+ private readonly pathJoiner;
13
+ private readonly genericTgzArchiver;
14
+ private constructor();
15
+ static newGrpcWebEnclaveContext(ipAddress: string, apiContainerGrpcProxyPortNum: number, enclaveId: string): Promise<Result<EnclaveContext, Error>>;
16
+ static newGrpcNodeEnclaveContext(ipAddress: string, apiContainerGrpcPortNum: number, enclaveId: string): Promise<Result<EnclaveContext, Error>>;
17
+ getEnclaveId(): EnclaveID;
18
+ loadModule(moduleId: ModuleID, image: string, serializedParams: string): Promise<Result<ModuleContext, Error>>;
19
+ unloadModule(moduleId: ModuleID): Promise<Result<null, Error>>;
20
+ getModuleContext(moduleId: ModuleID): Promise<Result<ModuleContext, Error>>;
21
+ addService(serviceId: ServiceID, containerConfig: ContainerConfig): Promise<Result<ServiceContext, Error>>;
22
+ addServices(containerConfigs: Map<ServiceID, ContainerConfig>): Promise<Result<[Map<ServiceID, ServiceContext>, Map<ServiceID, Error>], Error>>;
23
+ addServiceToPartition(serviceId: ServiceID, partitionId: PartitionID, containerConfig: ContainerConfig): Promise<Result<ServiceContext, Error>>;
24
+ addServicesToPartition(containerConfigs: Map<ServiceID, ContainerConfig>, partitionID: PartitionID): Promise<Result<[Map<ServiceID, ServiceContext>, Map<ServiceID, Error>], Error>>;
25
+ getServiceContext(serviceId: ServiceID): Promise<Result<ServiceContext, Error>>;
26
+ removeService(serviceId: ServiceID): Promise<Result<null, Error>>;
27
+ repartitionNetwork(partitionServices: Map<PartitionID, Set<ServiceID>>, partitionConnections: Map<PartitionID, Map<PartitionID, PartitionConnection>>, defaultConnection: PartitionConnection): Promise<Result<null, Error>>;
28
+ waitForHttpGetEndpointAvailability(serviceId: ServiceID, port: number, path: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
29
+ waitForHttpPostEndpointAvailability(serviceId: ServiceID, port: number, path: string, requestBody: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
30
+ getServices(): Promise<Result<Set<ServiceID>, Error>>;
31
+ getModules(): Promise<Result<Set<ModuleID>, Error>>;
32
+ uploadFiles(pathToArchive: string): Promise<Result<FilesArtifactUUID, Error>>;
33
+ storeWebFiles(url: string): Promise<Result<FilesArtifactUUID, Error>>;
34
+ storeServiceFiles(serviceId: ServiceID, absoluteFilepathOnServiceContainer: string): Promise<Result<FilesArtifactUUID, Error>>;
35
+ pauseService(serviceId: string): Promise<Result<null, Error>>;
36
+ unpauseService(serviceId: string): Promise<Result<null, Error>>;
37
+ renderTemplates(templateAndDataByDestinationRelFilepath: Map<string, TemplateAndData>): Promise<Result<FilesArtifactUUID, Error>>;
38
+ private static convertApiPortsToServiceContextPorts;
39
+ }
@@ -0,0 +1,501 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020 - present Kurtosis Technologies LLC.
4
+ * All Rights Reserved.
5
+ */
6
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ });
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.EnclaveContext = void 0;
17
+ const neverthrow_1 = require("neverthrow");
18
+ const loglevel_1 = require("loglevel");
19
+ const browser_or_node_1 = require("browser-or-node");
20
+ const grpc_node_api_container_client_1 = require("./grpc_node_api_container_client");
21
+ const grpc_web_api_container_client_1 = require("./grpc_web_api_container_client");
22
+ const module_context_1 = require("../modules/module_context");
23
+ const constructor_calls_1 = require("../constructor_calls");
24
+ const service_context_1 = require("../services/service_context");
25
+ const port_spec_1 = require("../services/port_spec");
26
+ // This will always resolve to the default partition ID (regardless of whether such a partition exists in the enclave,
27
+ // or it was repartitioned away)
28
+ const DEFAULT_PARTITION_ID = "";
29
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
30
+ class EnclaveContext {
31
+ constructor(backend, pathJoiner, genericTgzArchiver) {
32
+ this.backend = backend;
33
+ this.pathJoiner = pathJoiner;
34
+ this.genericTgzArchiver = genericTgzArchiver;
35
+ }
36
+ static newGrpcWebEnclaveContext(ipAddress, apiContainerGrpcProxyPortNum, enclaveId) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (browser_or_node_1.isNode) {
39
+ return (0, neverthrow_1.err)(new Error("It seems you're trying to create Enclave Context from Node environment. Please consider the 'newGrpcNodeEnclaveContext()' method instead."));
40
+ }
41
+ let genericApiContainerClient;
42
+ let genericTgzArchiver;
43
+ let pathJoiner;
44
+ try {
45
+ pathJoiner = yield Promise.resolve().then(() => require("path-browserify"));
46
+ const apiContainerServiceWeb = yield Promise.resolve().then(() => require("../../kurtosis_core_rpc_api_bindings/api_container_service_grpc_web_pb"));
47
+ const apiContainerGrpcProxyUrl = `${ipAddress}:${apiContainerGrpcProxyPortNum}`;
48
+ const apiContainerClient = new apiContainerServiceWeb.ApiContainerServiceClient(apiContainerGrpcProxyUrl);
49
+ genericApiContainerClient = new grpc_web_api_container_client_1.GrpcWebApiContainerClient(apiContainerClient, enclaveId);
50
+ const webFileArchiver = yield Promise.resolve().then(() => require("./web_tgz_archiver"));
51
+ genericTgzArchiver = new webFileArchiver.WebTgzArchiver();
52
+ }
53
+ catch (error) {
54
+ if (error instanceof Error) {
55
+ return (0, neverthrow_1.err)(error);
56
+ }
57
+ return (0, neverthrow_1.err)(new Error("An unknown exception value was thrown during creation of the API container client that wasn't an error: " + error));
58
+ }
59
+ const enclaveContext = new EnclaveContext(genericApiContainerClient, pathJoiner, genericTgzArchiver);
60
+ return (0, neverthrow_1.ok)(enclaveContext);
61
+ });
62
+ }
63
+ static newGrpcNodeEnclaveContext(ipAddress, apiContainerGrpcPortNum, enclaveId) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ if (!browser_or_node_1.isNode) {
66
+ return (0, neverthrow_1.err)(new Error("It seems you're trying to create Enclave Context from Web environment. Please consider the 'newGrpcWebEnclaveContext()' method instead."));
67
+ }
68
+ let genericApiContainerClient;
69
+ let genericTgzArchiver;
70
+ let pathJoiner;
71
+ //TODO Pull things that can't throw an error out of try statement.
72
+ try {
73
+ pathJoiner = yield Promise.resolve().then(() => require(/* webpackIgnore: true */ "path"));
74
+ const grpc_node = yield Promise.resolve().then(() => require(/* webpackIgnore: true */ "@grpc/grpc-js"));
75
+ const apiContainerServiceNode = yield Promise.resolve().then(() => require(/* webpackIgnore: true */ "../../kurtosis_core_rpc_api_bindings/api_container_service_grpc_pb"));
76
+ const apiContainerGrpcUrl = `${ipAddress}:${apiContainerGrpcPortNum}`;
77
+ const apiContainerClient = new apiContainerServiceNode.ApiContainerServiceClient(apiContainerGrpcUrl, grpc_node.credentials.createInsecure());
78
+ genericApiContainerClient = new grpc_node_api_container_client_1.GrpcNodeApiContainerClient(apiContainerClient, enclaveId);
79
+ const nodeTgzArchiver = yield Promise.resolve().then(() => require(/* webpackIgnore: true */ "./node_tgz_archiver"));
80
+ genericTgzArchiver = new nodeTgzArchiver.NodeTgzArchiver();
81
+ }
82
+ catch (error) {
83
+ if (error instanceof Error) {
84
+ return (0, neverthrow_1.err)(error);
85
+ }
86
+ return (0, neverthrow_1.err)(new Error("An unknown exception value was thrown during creation of the API container client that wasn't an error: " + error));
87
+ }
88
+ const enclaveContext = new EnclaveContext(genericApiContainerClient, pathJoiner, genericTgzArchiver);
89
+ return (0, neverthrow_1.ok)(enclaveContext);
90
+ });
91
+ }
92
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
93
+ getEnclaveId() {
94
+ return this.backend.getEnclaveId();
95
+ }
96
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
97
+ loadModule(moduleId, image, serializedParams) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ const loadModuleArgs = (0, constructor_calls_1.newLoadModuleArgs)(moduleId, image, serializedParams);
100
+ const loadModuleResult = yield this.backend.loadModule(loadModuleArgs);
101
+ if (loadModuleResult.isErr()) {
102
+ return (0, neverthrow_1.err)(loadModuleResult.error);
103
+ }
104
+ const moduleContext = new module_context_1.ModuleContext(this.backend, moduleId);
105
+ return (0, neverthrow_1.ok)(moduleContext);
106
+ });
107
+ }
108
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
109
+ unloadModule(moduleId) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ const unloadModuleArgs = (0, constructor_calls_1.newUnloadModuleArgs)(moduleId);
112
+ const unloadModuleResult = yield this.backend.unloadModule(unloadModuleArgs);
113
+ if (unloadModuleResult.isErr()) {
114
+ return (0, neverthrow_1.err)(unloadModuleResult.error);
115
+ }
116
+ // We discard the module GUID
117
+ return (0, neverthrow_1.ok)(null);
118
+ });
119
+ }
120
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
121
+ getModuleContext(moduleId) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const moduleMapForArgs = new Map();
124
+ moduleMapForArgs.set(moduleId, true);
125
+ const args = (0, constructor_calls_1.newGetModulesArgs)(moduleMapForArgs);
126
+ const getModuleInfoResult = yield this.backend.getModules(args);
127
+ if (getModuleInfoResult.isErr()) {
128
+ return (0, neverthrow_1.err)(getModuleInfoResult.error);
129
+ }
130
+ const resp = getModuleInfoResult.value;
131
+ if (!resp.getModuleInfoMap().has(moduleId)) {
132
+ return (0, neverthrow_1.err)(new Error(`Module '${moduleId}' does not exist`));
133
+ }
134
+ const moduleCtx = new module_context_1.ModuleContext(this.backend, moduleId);
135
+ return (0, neverthrow_1.ok)(moduleCtx);
136
+ });
137
+ }
138
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
139
+ addService(serviceId, containerConfig) {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ const containerConfigs = new Map();
142
+ containerConfigs.set(serviceId, containerConfig);
143
+ const resultAddServiceToPartition = yield this.addServicesToPartition(containerConfigs, DEFAULT_PARTITION_ID);
144
+ if (resultAddServiceToPartition.isErr()) {
145
+ return (0, neverthrow_1.err)(resultAddServiceToPartition.error);
146
+ }
147
+ const [successfulServices, failedService] = resultAddServiceToPartition.value;
148
+ const serviceErr = failedService.get(serviceId);
149
+ if (serviceErr != undefined) {
150
+ return (0, neverthrow_1.err)(new Error(`An error occurred adding service '${serviceId}' to the enclave in the default partition:\n${serviceErr}`));
151
+ }
152
+ const serviceCtx = successfulServices.get(serviceId);
153
+ if (serviceCtx == undefined) {
154
+ return (0, neverthrow_1.err)(new Error(`An error occurred retrieving the service context of service with ID ${serviceId} from result of adding service to partition. This should not happen and is a bug in Kurtosis.`));
155
+ }
156
+ return (0, neverthrow_1.ok)(serviceCtx);
157
+ });
158
+ }
159
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
160
+ addServices(containerConfigs) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ const resultAddServicesToPartition = yield this.addServicesToPartition(containerConfigs, DEFAULT_PARTITION_ID);
163
+ if (resultAddServicesToPartition.isErr()) {
164
+ return (0, neverthrow_1.err)(resultAddServicesToPartition.error);
165
+ }
166
+ return (0, neverthrow_1.ok)(resultAddServicesToPartition.value);
167
+ });
168
+ }
169
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
170
+ addServiceToPartition(serviceId, partitionId, containerConfig) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ const containerConfigs = new Map();
173
+ containerConfigs.set(serviceId, containerConfig);
174
+ const resultAddServiceToPartition = yield this.addServicesToPartition(containerConfigs, partitionId);
175
+ if (resultAddServiceToPartition.isErr()) {
176
+ return (0, neverthrow_1.err)(resultAddServiceToPartition.error);
177
+ }
178
+ const [successfulServices, failedService] = resultAddServiceToPartition.value;
179
+ const serviceErr = failedService.get(serviceId);
180
+ if (serviceErr != undefined) {
181
+ return (0, neverthrow_1.err)(new Error(`An error occurred adding service '${serviceId}' to the enclave in the default partition:\n${serviceErr}`));
182
+ }
183
+ const serviceCtx = successfulServices.get(serviceId);
184
+ if (serviceCtx == undefined) {
185
+ return (0, neverthrow_1.err)(new Error(`An error occurred retrieving the service context of service with ID ${serviceId} from result of adding service to partition. This should not happen and is a bug in Kurtosis.`));
186
+ }
187
+ return (0, neverthrow_1.ok)(serviceCtx);
188
+ });
189
+ }
190
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
191
+ addServicesToPartition(containerConfigs, partitionID) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const failedServicesPool = new Map();
194
+ const successfulServices = new Map();
195
+ const serviceConfigs = new Map();
196
+ for (const [serviceID, containerConfig] of containerConfigs.entries()) {
197
+ loglevel_1.default.trace(`Creating files artifact ID str -> mount dirpaths map for service with Id '${serviceID}'...`);
198
+ const artifactIdStrToMountDirpath = new Map();
199
+ for (const [filesArtifactId, mountDirpath] of containerConfig.filesArtifactMountpoints) {
200
+ artifactIdStrToMountDirpath.set(filesArtifactId, mountDirpath);
201
+ }
202
+ loglevel_1.default.trace(`Successfully created files artifact ID str -> mount dirpaths map for service with Id '${serviceID}'`);
203
+ const privatePorts = containerConfig.usedPorts;
204
+ const privatePortsForApi = new Map();
205
+ for (const [portId, portSpec] of privatePorts.entries()) {
206
+ const portSpecForApi = (0, constructor_calls_1.newPort)(portSpec.number, portSpec.protocol);
207
+ privatePortsForApi.set(portId, portSpecForApi);
208
+ }
209
+ //TODO this is a huge hack to temporarily enable static ports for NEAR until we have a more productized solution
210
+ const publicPorts = containerConfig.publicPorts;
211
+ const publicPortsForApi = new Map();
212
+ for (const [portId, portSpec] of publicPorts.entries()) {
213
+ const portSpecForApi = (0, constructor_calls_1.newPort)(portSpec.number, portSpec.protocol);
214
+ publicPortsForApi.set(portId, portSpecForApi);
215
+ }
216
+ //TODO finish the hack
217
+ const serviceConfig = (0, constructor_calls_1.newServiceConfig)(containerConfig.image, privatePortsForApi, publicPortsForApi, containerConfig.entrypointOverrideArgs, containerConfig.cmdOverrideArgs, containerConfig.environmentVariableOverrides, artifactIdStrToMountDirpath, containerConfig.cpuAllocationMillicpus, containerConfig.memoryAllocationMegabytes, containerConfig.privateIPAddrPlaceholder);
218
+ serviceConfigs.set(serviceID, serviceConfig);
219
+ }
220
+ loglevel_1.default.trace("Starting new services with Kurtosis API...");
221
+ const startServicesArgs = (0, constructor_calls_1.newStartServicesArgs)(serviceConfigs, partitionID);
222
+ const startServicesResponseResult = yield this.backend.startServices(startServicesArgs);
223
+ if (startServicesResponseResult.isErr()) {
224
+ return (0, neverthrow_1.err)(startServicesResponseResult.error);
225
+ }
226
+ const startServicesResponse = startServicesResponseResult.value;
227
+ const successfulServicesInfo = startServicesResponse.getSuccessfulServiceIdsToServiceInfoMap();
228
+ if (successfulServicesInfo === undefined) {
229
+ return (0, neverthrow_1.err)(new Error("Expected StartServicesResponse to contain a field that does not exist."));
230
+ }
231
+ // defer-undo removes all successfully started services in case of errors in the future phases
232
+ const shouldRemoveServices = new Map();
233
+ for (const [serviceIdStr, _] of successfulServicesInfo.entries()) {
234
+ shouldRemoveServices.set(serviceIdStr, true);
235
+ }
236
+ try {
237
+ // Add services that failed to start to failed services pool
238
+ const failedServices = startServicesResponse.getFailedServiceIdsToErrorMap();
239
+ if (failedServices === undefined) {
240
+ return (0, neverthrow_1.err)(new Error("Expected StartServicesResponse to contain a field that does not exist."));
241
+ }
242
+ for (const [serviceIdStr, serviceErrStr] of failedServices.entries()) {
243
+ const serviceId = serviceIdStr;
244
+ failedServicesPool.set(serviceId, new Error(serviceErrStr));
245
+ }
246
+ for (const [serviceIdStr, serviceInfo] of successfulServicesInfo.entries()) {
247
+ const serviceId = serviceIdStr;
248
+ const serviceCtxPrivatePorts = EnclaveContext.convertApiPortsToServiceContextPorts(serviceInfo.getPrivatePortsMap());
249
+ const serviceCtxPublicPorts = EnclaveContext.convertApiPortsToServiceContextPorts(serviceInfo.getMaybePublicPortsMap());
250
+ const serviceContext = new service_context_1.ServiceContext(this.backend, serviceId, serviceInfo.getPrivateIpAddr(), serviceCtxPrivatePorts, serviceInfo.getMaybePublicIpAddr(), serviceCtxPublicPorts);
251
+ successfulServices.set(serviceId, serviceContext);
252
+ loglevel_1.default.trace(`Successfully started service with ID '${serviceId}' with Kurtosis API`);
253
+ }
254
+ // Do not remove resources for successful services
255
+ for (const [serviceId, _] of successfulServices) {
256
+ shouldRemoveServices.delete(serviceId);
257
+ }
258
+ }
259
+ finally {
260
+ for (const [serviceId, _] of shouldRemoveServices) {
261
+ // Do a best effort attempt to remove resources for this object to clean up after it failed
262
+ // TODO: Migrate this to a bulk remove services call
263
+ const removeServiceArgs = (0, constructor_calls_1.newRemoveServiceArgs)(serviceId);
264
+ const removeServiceResult = yield this.backend.removeService(removeServiceArgs);
265
+ if (removeServiceResult.isErr()) {
266
+ const errMsg = `"Attempted to remove service '${serviceId}' to delete its resources after it failed to start, but the following error occurred " +
267
+ "while attempting to remove the service:\n ${removeServiceResult.error}`;
268
+ failedServicesPool.set(serviceId, new Error(errMsg));
269
+ }
270
+ }
271
+ }
272
+ return (0, neverthrow_1.ok)([successfulServices, failedServicesPool]);
273
+ });
274
+ }
275
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
276
+ getServiceContext(serviceId) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const serviceArgMap = new Map();
279
+ serviceArgMap.set(serviceId, true);
280
+ const getServiceInfoArgs = (0, constructor_calls_1.newGetServicesArgs)(serviceArgMap);
281
+ const getServicesResult = yield this.backend.getServices(getServiceInfoArgs);
282
+ if (getServicesResult.isErr()) {
283
+ return (0, neverthrow_1.err)(getServicesResult.error);
284
+ }
285
+ const serviceInfo = getServicesResult.value.getServiceInfoMap().get(serviceId);
286
+ if (!serviceInfo) {
287
+ return (0, neverthrow_1.err)(new Error("Failed to retrieve service information for service " + serviceId));
288
+ }
289
+ if (serviceInfo.getPrivateIpAddr() === "") {
290
+ return (0, neverthrow_1.err)(new Error("Kurtosis API reported an empty private IP address for service " + serviceId + " - this should never happen, and is a bug with Kurtosis!"));
291
+ }
292
+ if (serviceInfo.getMaybePublicIpAddr() === "") {
293
+ return (0, neverthrow_1.err)(new Error("Kurtosis API reported an empty public IP address for service " + serviceId + " - this should never happen, and is a bug with Kurtosis!"));
294
+ }
295
+ const serviceCtxPrivatePorts = EnclaveContext.convertApiPortsToServiceContextPorts(serviceInfo.getPrivatePortsMap());
296
+ const serviceCtxPublicPorts = EnclaveContext.convertApiPortsToServiceContextPorts(serviceInfo.getMaybePublicPortsMap());
297
+ const serviceContext = new service_context_1.ServiceContext(this.backend, serviceId, serviceInfo.getPrivateIpAddr(), serviceCtxPrivatePorts, serviceInfo.getMaybePublicIpAddr(), serviceCtxPublicPorts);
298
+ return (0, neverthrow_1.ok)(serviceContext);
299
+ });
300
+ }
301
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
302
+ removeService(serviceId) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ loglevel_1.default.debug("Removing service '" + serviceId + "'...");
305
+ const removeServiceArgs = (0, constructor_calls_1.newRemoveServiceArgs)(serviceId);
306
+ const removeServiceResult = yield this.backend.removeService(removeServiceArgs);
307
+ if (removeServiceResult.isErr()) {
308
+ return (0, neverthrow_1.err)(removeServiceResult.error);
309
+ }
310
+ loglevel_1.default.debug("Successfully removed service ID " + serviceId);
311
+ return (0, neverthrow_1.ok)(null);
312
+ });
313
+ }
314
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
315
+ repartitionNetwork(partitionServices, partitionConnections, defaultConnection) {
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ if (partitionServices === null) {
318
+ return (0, neverthrow_1.err)(new Error("Partition services map cannot be null"));
319
+ }
320
+ if (defaultConnection === null) {
321
+ return (0, neverthrow_1.err)(new Error("Default connection cannot be null"));
322
+ }
323
+ // Cover for lazy/confused users
324
+ if (partitionConnections === null) {
325
+ partitionConnections = new Map();
326
+ }
327
+ const reqPartitionServices = new Map();
328
+ for (const [partitionId, serviceIdSet] of partitionServices.entries()) {
329
+ const partitionIdStr = String(partitionId);
330
+ reqPartitionServices.set(partitionIdStr, (0, constructor_calls_1.newPartitionServices)(serviceIdSet));
331
+ }
332
+ const reqPartitionConns = new Map();
333
+ for (const [partitionAId, partitionAConnsMap] of partitionConnections.entries()) {
334
+ const partitionAConnsStrMap = new Map();
335
+ for (const [partitionBId, conn] of partitionAConnsMap.entries()) {
336
+ const partitionBIdStr = String(partitionBId);
337
+ partitionAConnsStrMap.set(partitionBIdStr, conn.getPartitionConnectionInfo());
338
+ }
339
+ const partitionAConns = (0, constructor_calls_1.newPartitionConnections)(partitionAConnsStrMap);
340
+ const partitionAIdStr = String(partitionAId);
341
+ reqPartitionConns.set(partitionAIdStr, partitionAConns);
342
+ }
343
+ const reqDefaultConnection = defaultConnection.getPartitionConnectionInfo();
344
+ const repartitionArgs = (0, constructor_calls_1.newRepartitionArgs)(reqPartitionServices, reqPartitionConns, reqDefaultConnection);
345
+ const repartitionNetworkResult = yield this.backend.repartitionNetwork(repartitionArgs);
346
+ if (repartitionNetworkResult.isErr()) {
347
+ return (0, neverthrow_1.err)(repartitionNetworkResult.error);
348
+ }
349
+ return (0, neverthrow_1.ok)(null);
350
+ });
351
+ }
352
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
353
+ waitForHttpGetEndpointAvailability(serviceId, port, path, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText) {
354
+ return __awaiter(this, void 0, void 0, function* () {
355
+ const availabilityArgs = (0, constructor_calls_1.newWaitForHttpGetEndpointAvailabilityArgs)(serviceId, port, path, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText);
356
+ const waitForHttpGetEndpointAvailabilityResult = yield this.backend.waitForHttpGetEndpointAvailability(availabilityArgs);
357
+ if (waitForHttpGetEndpointAvailabilityResult.isErr()) {
358
+ return (0, neverthrow_1.err)(waitForHttpGetEndpointAvailabilityResult.error);
359
+ }
360
+ const result = waitForHttpGetEndpointAvailabilityResult.value;
361
+ return (0, neverthrow_1.ok)(result);
362
+ });
363
+ }
364
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
365
+ waitForHttpPostEndpointAvailability(serviceId, port, path, requestBody, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText) {
366
+ return __awaiter(this, void 0, void 0, function* () {
367
+ const availabilityArgs = (0, constructor_calls_1.newWaitForHttpPostEndpointAvailabilityArgs)(serviceId, port, path, requestBody, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText);
368
+ return this.backend.waitForHttpPostEndpointAvailability(availabilityArgs);
369
+ });
370
+ }
371
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
372
+ getServices() {
373
+ return __awaiter(this, void 0, void 0, function* () {
374
+ const getAllServicesArgMap = new Map();
375
+ const emptyGetServicesArg = (0, constructor_calls_1.newGetServicesArgs)(getAllServicesArgMap);
376
+ const getServicesResponseResult = yield this.backend.getServices(emptyGetServicesArg);
377
+ if (getServicesResponseResult.isErr()) {
378
+ return (0, neverthrow_1.err)(getServicesResponseResult.error);
379
+ }
380
+ const getServicesResponse = getServicesResponseResult.value;
381
+ const serviceIDs = new Set();
382
+ getServicesResponse.getServiceInfoMap().forEach((value, key) => {
383
+ serviceIDs.add(key);
384
+ });
385
+ return (0, neverthrow_1.ok)(serviceIDs);
386
+ });
387
+ }
388
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
389
+ getModules() {
390
+ return __awaiter(this, void 0, void 0, function* () {
391
+ const getAllModulesArgMap = new Map();
392
+ const emptyGetModulesArg = (0, constructor_calls_1.newGetModulesArgs)(getAllModulesArgMap);
393
+ const getModulesResponseResult = yield this.backend.getModules(emptyGetModulesArg);
394
+ if (getModulesResponseResult.isErr()) {
395
+ return (0, neverthrow_1.err)(getModulesResponseResult.error);
396
+ }
397
+ const modulesResponse = getModulesResponseResult.value;
398
+ const moduleIds = new Set();
399
+ modulesResponse.getModuleInfoMap().forEach((value, key) => {
400
+ moduleIds.add(key);
401
+ });
402
+ return (0, neverthrow_1.ok)(moduleIds);
403
+ });
404
+ }
405
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
406
+ uploadFiles(pathToArchive) {
407
+ return __awaiter(this, void 0, void 0, function* () {
408
+ const archiverResponse = yield this.genericTgzArchiver.createTgzByteArray(pathToArchive);
409
+ if (archiverResponse.isErr()) {
410
+ return (0, neverthrow_1.err)(archiverResponse.error);
411
+ }
412
+ const args = (0, constructor_calls_1.newUploadFilesArtifactArgs)(archiverResponse.value);
413
+ const uploadResult = yield this.backend.uploadFiles(args);
414
+ if (uploadResult.isErr()) {
415
+ return (0, neverthrow_1.err)(uploadResult.error);
416
+ }
417
+ return (0, neverthrow_1.ok)(uploadResult.value.getUuid());
418
+ });
419
+ }
420
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
421
+ storeWebFiles(url) {
422
+ return __awaiter(this, void 0, void 0, function* () {
423
+ const args = (0, constructor_calls_1.newStoreWebFilesArtifactArgs)(url);
424
+ const storeWebFilesArtifactResponseResult = yield this.backend.storeWebFilesArtifact(args);
425
+ if (storeWebFilesArtifactResponseResult.isErr()) {
426
+ return (0, neverthrow_1.err)(storeWebFilesArtifactResponseResult.error);
427
+ }
428
+ const storeWebFilesArtifactResponse = storeWebFilesArtifactResponseResult.value;
429
+ return (0, neverthrow_1.ok)(storeWebFilesArtifactResponse.getUuid());
430
+ });
431
+ }
432
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
433
+ storeServiceFiles(serviceId, absoluteFilepathOnServiceContainer) {
434
+ return __awaiter(this, void 0, void 0, function* () {
435
+ const args = (0, constructor_calls_1.newStoreFilesArtifactFromServiceArgs)(serviceId, absoluteFilepathOnServiceContainer);
436
+ const storeFilesArtifactFromServiceResponseResult = yield this.backend.storeFilesArtifactFromService(args);
437
+ if (storeFilesArtifactFromServiceResponseResult.isErr()) {
438
+ return (0, neverthrow_1.err)(storeFilesArtifactFromServiceResponseResult.error);
439
+ }
440
+ const storeFilesArtifactFromServiceResponse = storeFilesArtifactFromServiceResponseResult.value;
441
+ return (0, neverthrow_1.ok)(storeFilesArtifactFromServiceResponse.getUuid());
442
+ });
443
+ }
444
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
445
+ pauseService(serviceId) {
446
+ return __awaiter(this, void 0, void 0, function* () {
447
+ const pauseServiceArgs = (0, constructor_calls_1.newPauseServiceArgs)(serviceId);
448
+ const pauseServiceResult = yield this.backend.pauseService(pauseServiceArgs);
449
+ if (pauseServiceResult.isErr()) {
450
+ return (0, neverthrow_1.err)(pauseServiceResult.error);
451
+ }
452
+ const pauseServiceResponse = pauseServiceResult.value;
453
+ return (0, neverthrow_1.ok)(null);
454
+ });
455
+ }
456
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
457
+ unpauseService(serviceId) {
458
+ return __awaiter(this, void 0, void 0, function* () {
459
+ const unpauseServiceArgs = (0, constructor_calls_1.newUnpauseServiceArgs)(serviceId);
460
+ const unpauseServiceResult = yield this.backend.unpauseService(unpauseServiceArgs);
461
+ if (unpauseServiceResult.isErr()) {
462
+ return (0, neverthrow_1.err)(unpauseServiceResult.error);
463
+ }
464
+ const pauseServiceResponse = unpauseServiceResult.value;
465
+ return (0, neverthrow_1.ok)(null);
466
+ });
467
+ }
468
+ // Docs available at https://docs.kurtosistech.com/kurtosis-core/lib-documentation
469
+ renderTemplates(templateAndDataByDestinationRelFilepath) {
470
+ return __awaiter(this, void 0, void 0, function* () {
471
+ if (templateAndDataByDestinationRelFilepath.size === 0) {
472
+ return (0, neverthrow_1.err)(new Error("Expected at least one template got 0"));
473
+ }
474
+ let renderTemplatesToFilesArtifactArgs = (0, constructor_calls_1.newRenderTemplatesToFilesArtifactArgs)();
475
+ let templateAndDataByRelDestinationFilepath = renderTemplatesToFilesArtifactArgs.getTemplatesAndDataByDestinationRelFilepathMap();
476
+ for (let [destinationRelFilepath, templateAndData] of templateAndDataByDestinationRelFilepath) {
477
+ const templateDataAsJsonString = JSON.stringify(templateAndData.templateData);
478
+ const templateAndDataAsJson = (0, constructor_calls_1.newTemplateAndData)(templateAndData.template, templateDataAsJsonString);
479
+ templateAndDataByRelDestinationFilepath.set(destinationRelFilepath, templateAndDataAsJson);
480
+ }
481
+ const renderTemplatesToFilesArtifactResult = yield this.backend.renderTemplatesToFilesArtifact(renderTemplatesToFilesArtifactArgs);
482
+ if (renderTemplatesToFilesArtifactResult.isErr()) {
483
+ return (0, neverthrow_1.err)(renderTemplatesToFilesArtifactResult.error);
484
+ }
485
+ return (0, neverthrow_1.ok)(renderTemplatesToFilesArtifactResult.value.getUuid());
486
+ });
487
+ }
488
+ // ====================================================================================================
489
+ // Private helper functions
490
+ // ====================================================================================================
491
+ static convertApiPortsToServiceContextPorts(apiPorts) {
492
+ const result = new Map();
493
+ for (const [portId, apiPortSpec] of apiPorts.entries()) {
494
+ const portProtocol = apiPortSpec.getProtocol();
495
+ const portNum = apiPortSpec.getNumber();
496
+ result.set(portId, new port_spec_1.PortSpec(portNum, portProtocol));
497
+ }
498
+ return result;
499
+ }
500
+ }
501
+ exports.EnclaveContext = EnclaveContext;
@@ -0,0 +1,23 @@
1
+ import { Result } from "neverthrow";
2
+ import { ExecCommandArgs, ExecCommandResponse, ExecuteModuleArgs, ExecuteModuleResponse, GetModulesArgs, GetModulesResponse, GetServicesArgs, GetServicesResponse, LoadModuleArgs, PauseServiceArgs, RemoveServiceArgs, RemoveServiceResponse, RenderTemplatesToFilesArtifactArgs, RenderTemplatesToFilesArtifactResponse, RepartitionArgs, StartServicesArgs, StartServicesResponse, StoreFilesArtifactFromServiceArgs, StoreWebFilesArtifactArgs, StoreWebFilesArtifactResponse, UnloadModuleArgs, UnloadModuleResponse, UnpauseServiceArgs, UploadFilesArtifactArgs, UploadFilesArtifactResponse, WaitForHttpGetEndpointAvailabilityArgs, WaitForHttpPostEndpointAvailabilityArgs } from "../../kurtosis_core_rpc_api_bindings/api_container_service_pb";
3
+ import { EnclaveID } from "./enclave_context";
4
+ export interface GenericApiContainerClient {
5
+ getEnclaveId(): EnclaveID;
6
+ loadModule(loadModuleArgs: LoadModuleArgs): Promise<Result<null, Error>>;
7
+ unloadModule(unloadModuleArgs: UnloadModuleArgs): Promise<Result<UnloadModuleResponse, Error>>;
8
+ startServices(startServicesArgs: StartServicesArgs): Promise<Result<StartServicesResponse, Error>>;
9
+ removeService(args: RemoveServiceArgs): Promise<Result<RemoveServiceResponse, Error>>;
10
+ repartitionNetwork(repartitionArgs: RepartitionArgs): Promise<Result<null, Error>>;
11
+ waitForHttpGetEndpointAvailability(availabilityArgs: WaitForHttpGetEndpointAvailabilityArgs): Promise<Result<null, Error>>;
12
+ waitForHttpPostEndpointAvailability(availabilityArgs: WaitForHttpPostEndpointAvailabilityArgs): Promise<Result<null, Error>>;
13
+ getServices(getServicesArgs: GetServicesArgs): Promise<Result<GetServicesResponse, Error>>;
14
+ getModules(getModulesArgs: GetModulesArgs): Promise<Result<GetModulesResponse, Error>>;
15
+ executeModule(executeModuleArgs: ExecuteModuleArgs): Promise<Result<ExecuteModuleResponse, Error>>;
16
+ execCommand(execCommandArgs: ExecCommandArgs): Promise<Result<ExecCommandResponse, Error>>;
17
+ pauseService(pauseServiceArgs: PauseServiceArgs): Promise<Result<null, Error>>;
18
+ unpauseService(unpauseServiceArgs: UnpauseServiceArgs): Promise<Result<null, Error>>;
19
+ uploadFiles(uploadFilesArtifactArgs: UploadFilesArtifactArgs): Promise<Result<UploadFilesArtifactResponse, Error>>;
20
+ storeWebFilesArtifact(storeWebFilesArtifactArgs: StoreWebFilesArtifactArgs): Promise<Result<StoreWebFilesArtifactResponse, Error>>;
21
+ storeFilesArtifactFromService(storeFilesArtifactFromServiceArgs: StoreFilesArtifactFromServiceArgs): Promise<Result<StoreWebFilesArtifactResponse, Error>>;
22
+ renderTemplatesToFilesArtifact(renderTemplatesToFilesArtifactArgs: RenderTemplatesToFilesArtifactArgs): Promise<Result<RenderTemplatesToFilesArtifactResponse, Error>>;
23
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022 - present Kurtosis Technologies Inc.
4
+ * All Rights Reserved.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface GenericPathJoiner {
2
+ join(firstPath: string, secondPath: string): string;
3
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022 - present Kurtosis Technologies Inc.
4
+ * All Rights Reserved.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { Result } from "neverthrow";
2
+ export interface GenericTgzArchiver {
3
+ createTgzByteArray(pathToArchive: string): Promise<Result<Uint8Array, Error>>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ import { Result } from "neverthrow";
2
+ import { StartServicesArgs, StartServicesResponse, RemoveServiceArgs, RepartitionArgs, WaitForHttpGetEndpointAvailabilityArgs, WaitForHttpPostEndpointAvailabilityArgs, GetServicesResponse, LoadModuleArgs, UnloadModuleArgs, GetModulesResponse, ExecuteModuleResponse, ExecuteModuleArgs, ExecCommandArgs, ExecCommandResponse, PauseServiceArgs, UnpauseServiceArgs, UploadFilesArtifactArgs, UploadFilesArtifactResponse, StoreWebFilesArtifactArgs, StoreWebFilesArtifactResponse, StoreFilesArtifactFromServiceArgs, GetServicesArgs, GetModulesArgs, UnloadModuleResponse, RenderTemplatesToFilesArtifactArgs, RenderTemplatesToFilesArtifactResponse } from "../../kurtosis_core_rpc_api_bindings/api_container_service_pb";
3
+ import type { ApiContainerServiceClient as ApiContainerServiceClientNode } from "../../kurtosis_core_rpc_api_bindings/api_container_service_grpc_pb";
4
+ import { GenericApiContainerClient } from "./generic_api_container_client";
5
+ import { EnclaveID } from "./enclave_context";
6
+ import { RemoveServiceResponse } from "../../kurtosis_core_rpc_api_bindings/api_container_service_pb";
7
+ export declare class GrpcNodeApiContainerClient implements GenericApiContainerClient {
8
+ private readonly client;
9
+ private readonly enclaveId;
10
+ constructor(client: ApiContainerServiceClientNode, enclaveId: EnclaveID);
11
+ getEnclaveId(): EnclaveID;
12
+ loadModule(loadModuleArgs: LoadModuleArgs): Promise<Result<null, Error>>;
13
+ unloadModule(unloadModuleArgs: UnloadModuleArgs): Promise<Result<UnloadModuleResponse, Error>>;
14
+ startServices(startServicesArgs: StartServicesArgs): Promise<Result<StartServicesResponse, Error>>;
15
+ removeService(args: RemoveServiceArgs): Promise<Result<RemoveServiceResponse, Error>>;
16
+ repartitionNetwork(repartitionArgs: RepartitionArgs): Promise<Result<null, Error>>;
17
+ waitForHttpGetEndpointAvailability(availabilityArgs: WaitForHttpGetEndpointAvailabilityArgs): Promise<Result<null, Error>>;
18
+ waitForHttpPostEndpointAvailability(availabilityArgs: WaitForHttpPostEndpointAvailabilityArgs): Promise<Result<null, Error>>;
19
+ getServices(getServicesArgs: GetServicesArgs): Promise<Result<GetServicesResponse, Error>>;
20
+ getModules(getModulesArgs: GetModulesArgs): Promise<Result<GetModulesResponse, Error>>;
21
+ executeModule(executeModuleArgs: ExecuteModuleArgs): Promise<Result<ExecuteModuleResponse, Error>>;
22
+ execCommand(execCommandArgs: ExecCommandArgs): Promise<Result<ExecCommandResponse, Error>>;
23
+ pauseService(pauseServiceArgs: PauseServiceArgs): Promise<Result<null, Error>>;
24
+ unpauseService(unpauseServiceArgs: UnpauseServiceArgs): Promise<Result<null, Error>>;
25
+ uploadFiles(uploadFilesArtifactArgs: UploadFilesArtifactArgs): Promise<Result<UploadFilesArtifactResponse, Error>>;
26
+ storeWebFilesArtifact(storeWebFilesArtifactArgs: StoreWebFilesArtifactArgs): Promise<Result<StoreWebFilesArtifactResponse, Error>>;
27
+ storeFilesArtifactFromService(storeFilesArtifactFromServiceArgs: StoreFilesArtifactFromServiceArgs): Promise<Result<StoreWebFilesArtifactResponse, Error>>;
28
+ renderTemplatesToFilesArtifact(renderTemplatesToFilesArtifactArgs: RenderTemplatesToFilesArtifactArgs): Promise<Result<RenderTemplatesToFilesArtifactResponse, Error>>;
29
+ }