@hpcc-js/comms 3.15.4 → 3.15.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.
- package/LICENSE +43 -43
- package/README.md +50 -50
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -1
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +2 -2
- package/package.json +5 -5
- package/src/__package__.ts +3 -3
- package/src/clienttools/eclMeta.ts +506 -506
- package/src/clienttools/eclcc.ts +628 -628
- package/src/connection.ts +288 -288
- package/src/ecl/activity.ts +82 -82
- package/src/ecl/dfuWorkunit.ts +363 -363
- package/src/ecl/graph.ts +196 -196
- package/src/ecl/logicalFile.ts +196 -196
- package/src/ecl/machine.ts +63 -63
- package/src/ecl/query.ts +265 -265
- package/src/ecl/queryGraph.ts +813 -813
- package/src/ecl/resource.ts +39 -39
- package/src/ecl/result.ts +245 -245
- package/src/ecl/scope.ts +188 -188
- package/src/ecl/sourceFile.ts +34 -34
- package/src/ecl/store.ts +154 -154
- package/src/ecl/targetCluster.ts +149 -149
- package/src/ecl/timer.ts +42 -42
- package/src/ecl/topology.ts +131 -131
- package/src/ecl/workunit.ts +1340 -1340
- package/src/ecl/xsdParser.ts +267 -267
- package/src/espConnection.ts +164 -164
- package/src/index.browser.ts +1 -1
- package/src/index.common.ts +40 -40
- package/src/index.node.ts +48 -48
- package/src/pem/trustwave.ts +909 -909
- package/src/services/fileSpray.ts +73 -73
- package/src/services/wsAccess.ts +8 -8
- package/src/services/wsAccount.ts +27 -27
- package/src/services/wsCloud.ts +73 -73
- package/src/services/wsCodesign.ts +18 -18
- package/src/services/wsDFU.ts +34 -34
- package/src/services/wsDFUXRef.ts +121 -121
- package/src/services/wsDali.ts +8 -8
- package/src/services/wsEcl.ts +123 -123
- package/src/services/wsElk.ts +8 -8
- package/src/services/wsLogaccess.ts +270 -270
- package/src/services/wsMachine.ts +89 -89
- package/src/services/wsPackageProcess.ts +8 -8
- package/src/services/wsResources.ts +8 -8
- package/src/services/wsSMC.ts +80 -80
- package/src/services/wsSasha.ts +7 -7
- package/src/services/wsStore.ts +32 -32
- package/src/services/wsTopology.ts +45 -45
- package/src/services/wsWorkunits.ts +151 -151
- package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
- package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
- package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
- package/src/services/wsdl/FileSpray/v1.27/FileSpray.ts +930 -930
- package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
- package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
- package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
- package/src/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts +227 -227
- package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
- package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
- package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
- package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
- package/src/services/wsdl/WsDfu/v1.66/WsDfu.ts +1267 -1267
- package/src/services/wsdl/WsDfu/v1.67/WsDfu.ts +1268 -1268
- package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +104 -104
- package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
- package/src/services/wsdl/WsPackageProcess/v1.07/WsPackageProcess.ts +500 -500
- package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
- package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
- package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +591 -591
- package/src/services/wsdl/WsSMC/v1.28/WsSMC.ts +645 -645
- package/src/services/wsdl/WsSMC/v1.29/WsSMC.ts +660 -660
- package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
- package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +786 -786
- package/src/services/wsdl/WsTopology/v1.33/WsTopology.ts +835 -835
- package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
- package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
- package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
- package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
- package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
- package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
- package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
- package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3162 -3162
- package/src/services/wsdl/WsWorkunits/v2.03/WsWorkunits.ts +3164 -3164
- package/src/services/wsdl/WsWorkunits/v2.04/WsWorkunits.ts +3171 -3171
- package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
- package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
- package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
- package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
- package/src/services/wsdl/ws_account/v1.07/ws_account.ts +114 -114
- package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +95 -95
- package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
- package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
- package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
- package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
- package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
- package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
- package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
- package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
- package/src/services/wsdl/ws_machine/v1.18/ws_machine.ts +497 -497
- package/src/services/wsdl/ws_machine/v1.19/ws_machine.ts +497 -497
- package/src/services/wsdl/wsstore/v1.02/wsstore.ts +239 -239
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { FileSprayServiceBase, FileSpray } from "./wsdl/FileSpray/v1.27/FileSpray.ts";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
FileSpray
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
type UpdateDFUWorkunitMinusWU = Omit<FileSpray.UpdateDFUWorkunit, "wu">;
|
|
8
|
-
type UpdateDFUWorkunitWU = FileSpray.UpdateDFUWorkunit["wu"];
|
|
9
|
-
|
|
10
|
-
export enum FileSprayStates {
|
|
11
|
-
unknown = 0,
|
|
12
|
-
scheduled,
|
|
13
|
-
queued,
|
|
14
|
-
started,
|
|
15
|
-
aborted,
|
|
16
|
-
failed,
|
|
17
|
-
finished,
|
|
18
|
-
monitoring,
|
|
19
|
-
aborting,
|
|
20
|
-
notfound = 999
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// defined in https://github.com/hpcc-systems/HPCC-Platform/blob/master/dali/dfu/dfuwu.cpp#L102-L121
|
|
24
|
-
export enum DFUWUTypes {
|
|
25
|
-
Copy = "copy",
|
|
26
|
-
Remove = "remove",
|
|
27
|
-
Move = "move",
|
|
28
|
-
Rename = "rename",
|
|
29
|
-
Replicate = "replicate",
|
|
30
|
-
Import = "import",
|
|
31
|
-
Export = "export",
|
|
32
|
-
/*
|
|
33
|
-
* These seem to not be valid with respect to filtering DFU WUs,
|
|
34
|
-
* but leaving them here because they exist in the dfuwu.cpp struct
|
|
35
|
-
*
|
|
36
|
-
* Add = "add",
|
|
37
|
-
* Transfer = "transfer",
|
|
38
|
-
* Savemap = "savemap",
|
|
39
|
-
* Addgroup = "addgroup",
|
|
40
|
-
* Server = "server",
|
|
41
|
-
*/
|
|
42
|
-
Monitor = "monitor",
|
|
43
|
-
Copymerge = "copymerge",
|
|
44
|
-
Supercopy = "supercopy",
|
|
45
|
-
Publish = "publish",
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface UpdateDFUWorkunitEx extends UpdateDFUWorkunitMinusWU {
|
|
49
|
-
wu?: Partial<UpdateDFUWorkunitWU>
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class FileSprayService extends FileSprayServiceBase {
|
|
53
|
-
|
|
54
|
-
DFUWUFileEx(request: FileSpray.DFUWUFileRequest): Promise<string> {
|
|
55
|
-
return this._connection.send("DFUWUFile", request, "text");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
SprayFixedEx(request: Partial<FileSpray.SprayFixed>): Promise<FileSpray.SprayFixedResponse> {
|
|
59
|
-
return this._connection.send("SprayFixed", request);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
SprayVariableEx(request: Partial<FileSpray.SprayVariable>): Promise<FileSpray.SprayResponse> {
|
|
63
|
-
return this._connection.send("SprayVariable", request, "json", false, null, "SprayResponse");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
DesprayEx(request: Partial<FileSpray.Despray>): Promise<FileSpray.DesprayResponse> {
|
|
67
|
-
return this._connection.send("Despray", request);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
UpdateDFUWorkunitEx(request: Partial<UpdateDFUWorkunitEx>): Promise<FileSpray.UpdateDFUWorkunitResponse> {
|
|
71
|
-
return this._connection.send("UpdateDFUWorkunit", request, "json", false, undefined, "UpdateDFUWorkunitResponse");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
import { FileSprayServiceBase, FileSpray } from "./wsdl/FileSpray/v1.27/FileSpray.ts";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
FileSpray
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
type UpdateDFUWorkunitMinusWU = Omit<FileSpray.UpdateDFUWorkunit, "wu">;
|
|
8
|
+
type UpdateDFUWorkunitWU = FileSpray.UpdateDFUWorkunit["wu"];
|
|
9
|
+
|
|
10
|
+
export enum FileSprayStates {
|
|
11
|
+
unknown = 0,
|
|
12
|
+
scheduled,
|
|
13
|
+
queued,
|
|
14
|
+
started,
|
|
15
|
+
aborted,
|
|
16
|
+
failed,
|
|
17
|
+
finished,
|
|
18
|
+
monitoring,
|
|
19
|
+
aborting,
|
|
20
|
+
notfound = 999
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// defined in https://github.com/hpcc-systems/HPCC-Platform/blob/master/dali/dfu/dfuwu.cpp#L102-L121
|
|
24
|
+
export enum DFUWUTypes {
|
|
25
|
+
Copy = "copy",
|
|
26
|
+
Remove = "remove",
|
|
27
|
+
Move = "move",
|
|
28
|
+
Rename = "rename",
|
|
29
|
+
Replicate = "replicate",
|
|
30
|
+
Import = "import",
|
|
31
|
+
Export = "export",
|
|
32
|
+
/*
|
|
33
|
+
* These seem to not be valid with respect to filtering DFU WUs,
|
|
34
|
+
* but leaving them here because they exist in the dfuwu.cpp struct
|
|
35
|
+
*
|
|
36
|
+
* Add = "add",
|
|
37
|
+
* Transfer = "transfer",
|
|
38
|
+
* Savemap = "savemap",
|
|
39
|
+
* Addgroup = "addgroup",
|
|
40
|
+
* Server = "server",
|
|
41
|
+
*/
|
|
42
|
+
Monitor = "monitor",
|
|
43
|
+
Copymerge = "copymerge",
|
|
44
|
+
Supercopy = "supercopy",
|
|
45
|
+
Publish = "publish",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface UpdateDFUWorkunitEx extends UpdateDFUWorkunitMinusWU {
|
|
49
|
+
wu?: Partial<UpdateDFUWorkunitWU>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class FileSprayService extends FileSprayServiceBase {
|
|
53
|
+
|
|
54
|
+
DFUWUFileEx(request: FileSpray.DFUWUFileRequest): Promise<string> {
|
|
55
|
+
return this._connection.send("DFUWUFile", request, "text");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
SprayFixedEx(request: Partial<FileSpray.SprayFixed>): Promise<FileSpray.SprayFixedResponse> {
|
|
59
|
+
return this._connection.send("SprayFixed", request);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
SprayVariableEx(request: Partial<FileSpray.SprayVariable>): Promise<FileSpray.SprayResponse> {
|
|
63
|
+
return this._connection.send("SprayVariable", request, "json", false, null, "SprayResponse");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
DesprayEx(request: Partial<FileSpray.Despray>): Promise<FileSpray.DesprayResponse> {
|
|
67
|
+
return this._connection.send("Despray", request);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
UpdateDFUWorkunitEx(request: Partial<UpdateDFUWorkunitEx>): Promise<FileSpray.UpdateDFUWorkunitResponse> {
|
|
71
|
+
return this._connection.send("UpdateDFUWorkunit", request, "json", false, undefined, "UpdateDFUWorkunitResponse");
|
|
72
|
+
}
|
|
73
|
+
}
|
package/src/services/wsAccess.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AccessServiceBase, WsAccess } from "./wsdl/ws_access/v1.17/ws_access.ts";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
WsAccess
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export class AccessService extends AccessServiceBase {
|
|
8
|
-
}
|
|
1
|
+
import { AccessServiceBase, WsAccess } from "./wsdl/ws_access/v1.17/ws_access.ts";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
WsAccess
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class AccessService extends AccessServiceBase {
|
|
8
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { AccountServiceBase, WsAccount } from "./wsdl/ws_account/v1.07/ws_account.ts";
|
|
2
|
-
import { ESPExceptions } from "../espConnection.ts";
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
type WsAccount
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export class AccountService extends AccountServiceBase {
|
|
9
|
-
|
|
10
|
-
VerifyUser(request: WsAccount.VerifyUserRequest): Promise<WsAccount.VerifyUserResponse> {
|
|
11
|
-
return this._connection.send("VerifyUser", request)
|
|
12
|
-
.catch((e: ESPExceptions) => {
|
|
13
|
-
// old client version warning ---
|
|
14
|
-
if (e.isESPExceptions && e.Exception.some(exception => exception.Code === 20043)) {
|
|
15
|
-
return {
|
|
16
|
-
retcode: 20043,
|
|
17
|
-
Exceptions: {
|
|
18
|
-
Source: "wsAccount",
|
|
19
|
-
Exception: e.Exception
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
throw e;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
import { AccountServiceBase, WsAccount } from "./wsdl/ws_account/v1.07/ws_account.ts";
|
|
2
|
+
import { ESPExceptions } from "../espConnection.ts";
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
type WsAccount
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export class AccountService extends AccountServiceBase {
|
|
9
|
+
|
|
10
|
+
VerifyUser(request: WsAccount.VerifyUserRequest): Promise<WsAccount.VerifyUserResponse> {
|
|
11
|
+
return this._connection.send("VerifyUser", request)
|
|
12
|
+
.catch((e: ESPExceptions) => {
|
|
13
|
+
// old client version warning ---
|
|
14
|
+
if (e.isESPExceptions && e.Exception.some(exception => exception.Code === 20043)) {
|
|
15
|
+
return {
|
|
16
|
+
retcode: 20043,
|
|
17
|
+
Exceptions: {
|
|
18
|
+
Source: "wsAccount",
|
|
19
|
+
Exception: e.Exception
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
throw e;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
package/src/services/wsCloud.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { scopedLogger } from "@hpcc-js/util";
|
|
2
|
-
import type { V1Pod } from "@kubernetes/client-node";
|
|
3
|
-
import type { WsCloud as WsCloudV1 } from "./wsdl/WsCloud/v1/WsCloud.ts";
|
|
4
|
-
import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1.02/WsCloud.ts";
|
|
5
|
-
|
|
6
|
-
const logger = scopedLogger("@hpcc-js/comms/services/wsCloud.ts");
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
type WsCloud
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
function isGetPODsResponse_v1_02(response: any): response is WsCloud.GetPODsResponse {
|
|
13
|
-
return response?.Pods !== undefined;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function mapPorts(pod: V1Pod): WsCloud.Port[] {
|
|
17
|
-
return pod.spec?.containers?.reduce((prev, curr) => {
|
|
18
|
-
curr.ports?.forEach(p => {
|
|
19
|
-
prev.push({
|
|
20
|
-
ContainerPort: p.containerPort,
|
|
21
|
-
Name: p.name,
|
|
22
|
-
Protocol: p.protocol
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
return prev;
|
|
26
|
-
}, [] as WsCloud.Port[]) ?? [];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function mapPods(pods: V1Pod[]): WsCloud.Pod[] {
|
|
30
|
-
return pods
|
|
31
|
-
.filter(pod => {
|
|
32
|
-
const labels = pod?.metadata?.labels ?? {};
|
|
33
|
-
return labels.hasOwnProperty("app.kubernetes.io/part-of") && labels["app.kubernetes.io/part-of"] === "HPCC-Platform";
|
|
34
|
-
})
|
|
35
|
-
.map((pod: V1Pod): WsCloud.Pod => {
|
|
36
|
-
const started = new Date(pod.metadata?.creationTimestamp);
|
|
37
|
-
return {
|
|
38
|
-
Name: pod.metadata.name,
|
|
39
|
-
Status: pod.status?.phase,
|
|
40
|
-
CreationTimestamp: started.toISOString(),
|
|
41
|
-
ContainerName: pod.status?.containerStatuses?.reduce((prev, curr) => {
|
|
42
|
-
if (curr.name) {
|
|
43
|
-
prev.push(curr.name);
|
|
44
|
-
} return prev;
|
|
45
|
-
}, [] as string[]).join(", ") ?? "",
|
|
46
|
-
ContainerCount: pod.spec?.containers?.length ?? 0,
|
|
47
|
-
ContainerReadyCount: pod.status?.containerStatuses?.reduce((prev, curr) => prev + (curr.ready ? 1 : 0), 0),
|
|
48
|
-
ContainerRestartCount: pod.status?.containerStatuses?.reduce((prev, curr) => prev + curr.restartCount, 0),
|
|
49
|
-
Ports: {
|
|
50
|
-
Port: mapPorts(pod)
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
})
|
|
54
|
-
;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export class CloudService extends CloudServiceBase {
|
|
58
|
-
|
|
59
|
-
getPODs(): Promise<WsCloud.Pod[]> {
|
|
60
|
-
return super.GetPODs({}).then((response: WsCloud.GetPODsResponse | WsCloudV1.GetPODsResponse) => {
|
|
61
|
-
if (isGetPODsResponse_v1_02(response)) {
|
|
62
|
-
return response.Pods?.Pod ?? [];
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
const obj = typeof response.Result === "string" ? JSON.parse(response.Result) : response.Result;
|
|
66
|
-
return mapPods(obj?.items ?? []);
|
|
67
|
-
} catch (error) {
|
|
68
|
-
logger.error(`Error parsing V1Pods json '${(error instanceof Error ? error.message : String(error))}'`);
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
import { scopedLogger } from "@hpcc-js/util";
|
|
2
|
+
import type { V1Pod } from "@kubernetes/client-node";
|
|
3
|
+
import type { WsCloud as WsCloudV1 } from "./wsdl/WsCloud/v1/WsCloud.ts";
|
|
4
|
+
import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1.02/WsCloud.ts";
|
|
5
|
+
|
|
6
|
+
const logger = scopedLogger("@hpcc-js/comms/services/wsCloud.ts");
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
type WsCloud
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function isGetPODsResponse_v1_02(response: any): response is WsCloud.GetPODsResponse {
|
|
13
|
+
return response?.Pods !== undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function mapPorts(pod: V1Pod): WsCloud.Port[] {
|
|
17
|
+
return pod.spec?.containers?.reduce((prev, curr) => {
|
|
18
|
+
curr.ports?.forEach(p => {
|
|
19
|
+
prev.push({
|
|
20
|
+
ContainerPort: p.containerPort,
|
|
21
|
+
Name: p.name,
|
|
22
|
+
Protocol: p.protocol
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return prev;
|
|
26
|
+
}, [] as WsCloud.Port[]) ?? [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function mapPods(pods: V1Pod[]): WsCloud.Pod[] {
|
|
30
|
+
return pods
|
|
31
|
+
.filter(pod => {
|
|
32
|
+
const labels = pod?.metadata?.labels ?? {};
|
|
33
|
+
return labels.hasOwnProperty("app.kubernetes.io/part-of") && labels["app.kubernetes.io/part-of"] === "HPCC-Platform";
|
|
34
|
+
})
|
|
35
|
+
.map((pod: V1Pod): WsCloud.Pod => {
|
|
36
|
+
const started = new Date(pod.metadata?.creationTimestamp);
|
|
37
|
+
return {
|
|
38
|
+
Name: pod.metadata.name,
|
|
39
|
+
Status: pod.status?.phase,
|
|
40
|
+
CreationTimestamp: started.toISOString(),
|
|
41
|
+
ContainerName: pod.status?.containerStatuses?.reduce((prev, curr) => {
|
|
42
|
+
if (curr.name) {
|
|
43
|
+
prev.push(curr.name);
|
|
44
|
+
} return prev;
|
|
45
|
+
}, [] as string[]).join(", ") ?? "",
|
|
46
|
+
ContainerCount: pod.spec?.containers?.length ?? 0,
|
|
47
|
+
ContainerReadyCount: pod.status?.containerStatuses?.reduce((prev, curr) => prev + (curr.ready ? 1 : 0), 0),
|
|
48
|
+
ContainerRestartCount: pod.status?.containerStatuses?.reduce((prev, curr) => prev + curr.restartCount, 0),
|
|
49
|
+
Ports: {
|
|
50
|
+
Port: mapPorts(pod)
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
})
|
|
54
|
+
;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class CloudService extends CloudServiceBase {
|
|
58
|
+
|
|
59
|
+
getPODs(): Promise<WsCloud.Pod[]> {
|
|
60
|
+
return super.GetPODs({}).then((response: WsCloud.GetPODsResponse | WsCloudV1.GetPODsResponse) => {
|
|
61
|
+
if (isGetPODsResponse_v1_02(response)) {
|
|
62
|
+
return response.Pods?.Pod ?? [];
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const obj = typeof response.Result === "string" ? JSON.parse(response.Result) : response.Result;
|
|
66
|
+
return mapPods(obj?.items ?? []);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
logger.error(`Error parsing V1Pods json '${(error instanceof Error ? error.message : String(error))}'`);
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CodesignServiceBase, WsCodesign } from "./wsdl/ws_codesign/v1.1/ws_codesign.ts";
|
|
2
|
-
|
|
3
|
-
export { WsCodesign };
|
|
4
|
-
|
|
5
|
-
export class CodesignService extends CodesignServiceBase {
|
|
6
|
-
|
|
7
|
-
ListUserIDsEx(request: Partial<WsCodesign.ListUserIDsRequest>): Promise<string[]> {
|
|
8
|
-
return super.ListUserIDs(request).then((response: WsCodesign.ListUserIDsResponse) => {
|
|
9
|
-
return response.UserIDs.Item;
|
|
10
|
-
}).catch(e => {
|
|
11
|
-
return [];
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
Sign(request: Partial<WsCodesign.SignRequest>): Promise<WsCodesign.SignResponse> {
|
|
16
|
-
return super.Sign({ SigningMethod: WsCodesign.SigningMethodType.gpg, ...request });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import { CodesignServiceBase, WsCodesign } from "./wsdl/ws_codesign/v1.1/ws_codesign.ts";
|
|
2
|
+
|
|
3
|
+
export { WsCodesign };
|
|
4
|
+
|
|
5
|
+
export class CodesignService extends CodesignServiceBase {
|
|
6
|
+
|
|
7
|
+
ListUserIDsEx(request: Partial<WsCodesign.ListUserIDsRequest>): Promise<string[]> {
|
|
8
|
+
return super.ListUserIDs(request).then((response: WsCodesign.ListUserIDsResponse) => {
|
|
9
|
+
return response.UserIDs.Item;
|
|
10
|
+
}).catch(e => {
|
|
11
|
+
return [];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Sign(request: Partial<WsCodesign.SignRequest>): Promise<WsCodesign.SignResponse> {
|
|
16
|
+
return super.Sign({ SigningMethod: WsCodesign.SigningMethodType.gpg, ...request });
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/services/wsDFU.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { DfuServiceBase, WsDfu } from "./wsdl/WsDfu/v1.67/WsDfu.ts";
|
|
2
|
-
|
|
3
|
-
export { WsDfu };
|
|
4
|
-
|
|
5
|
-
export const DFUArrayActions = WsDfu.DFUArrayActions;
|
|
6
|
-
export const DFUDefFileFormat = WsDfu.DFUDefFileFormat;
|
|
7
|
-
export const DFUChangeProtection = WsDfu.DFUChangeProtection;
|
|
8
|
-
export const DFUChangeRestriction = WsDfu.DFUChangeRestriction;
|
|
9
|
-
|
|
10
|
-
export type base64Binary = WsDfu.base64Binary;
|
|
11
|
-
|
|
12
|
-
export class DFUService extends DfuServiceBase {
|
|
13
|
-
|
|
14
|
-
DFUFile(request: WsDfu.DFUDefFileRequest): Promise<string> {
|
|
15
|
-
return this._connection.send("DFUDefFile", request, "text");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async recursiveFetchLogicalFiles(superFiles: { NodeGroup: string, Name: string }[]): Promise<string[]> {
|
|
19
|
-
const childSuperFiles: WsDfu.DFULogicalFile[] = [];
|
|
20
|
-
const logicalFiles: string[] = [];
|
|
21
|
-
await Promise.all(superFiles.map(superFile => {
|
|
22
|
-
return this.DFUInfo({ Cluster: superFile.NodeGroup, Name: superFile.Name, IncludeJsonTypeInfo: false, IncludeBinTypeInfo: false, ForceIndexInfo: false })
|
|
23
|
-
.then(response => {
|
|
24
|
-
for (const child of response?.FileDetail?.Superfiles?.DFULogicalFile ?? []) {
|
|
25
|
-
childSuperFiles.push(child);
|
|
26
|
-
}
|
|
27
|
-
for (const child of response?.FileDetail?.subfiles?.Item ?? []) {
|
|
28
|
-
logicalFiles.push(child);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}));
|
|
32
|
-
return logicalFiles.concat(childSuperFiles.length ? await this.recursiveFetchLogicalFiles(childSuperFiles) : []);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
import { DfuServiceBase, WsDfu } from "./wsdl/WsDfu/v1.67/WsDfu.ts";
|
|
2
|
+
|
|
3
|
+
export { WsDfu };
|
|
4
|
+
|
|
5
|
+
export const DFUArrayActions = WsDfu.DFUArrayActions;
|
|
6
|
+
export const DFUDefFileFormat = WsDfu.DFUDefFileFormat;
|
|
7
|
+
export const DFUChangeProtection = WsDfu.DFUChangeProtection;
|
|
8
|
+
export const DFUChangeRestriction = WsDfu.DFUChangeRestriction;
|
|
9
|
+
|
|
10
|
+
export type base64Binary = WsDfu.base64Binary;
|
|
11
|
+
|
|
12
|
+
export class DFUService extends DfuServiceBase {
|
|
13
|
+
|
|
14
|
+
DFUFile(request: WsDfu.DFUDefFileRequest): Promise<string> {
|
|
15
|
+
return this._connection.send("DFUDefFile", request, "text");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async recursiveFetchLogicalFiles(superFiles: { NodeGroup: string, Name: string }[]): Promise<string[]> {
|
|
19
|
+
const childSuperFiles: WsDfu.DFULogicalFile[] = [];
|
|
20
|
+
const logicalFiles: string[] = [];
|
|
21
|
+
await Promise.all(superFiles.map(superFile => {
|
|
22
|
+
return this.DFUInfo({ Cluster: superFile.NodeGroup, Name: superFile.Name, IncludeJsonTypeInfo: false, IncludeBinTypeInfo: false, ForceIndexInfo: false })
|
|
23
|
+
.then(response => {
|
|
24
|
+
for (const child of response?.FileDetail?.Superfiles?.DFULogicalFile ?? []) {
|
|
25
|
+
childSuperFiles.push(child);
|
|
26
|
+
}
|
|
27
|
+
for (const child of response?.FileDetail?.subfiles?.Item ?? []) {
|
|
28
|
+
logicalFiles.push(child);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}));
|
|
32
|
+
return logicalFiles.concat(childSuperFiles.length ? await this.recursiveFetchLogicalFiles(childSuperFiles) : []);
|
|
33
|
+
}
|
|
34
|
+
}
|