Skip to content

Commit c0d02a3

Browse files
committed
feat: bump WsCloud to latest version
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent cf470f2 commit c0d02a3

File tree

2 files changed

+79
-13
lines changed

2 files changed

+79
-13
lines changed
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1/WsCloud";
1+
import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1.02/WsCloud";
22

33
export {
4-
WsCloud
4+
type WsCloud
55
};
66

77
export class CloudService extends CloudServiceBase {
88

9-
getPODs(): Promise<object[]> {
10-
return super.GetPODs({}).then((response) => {
11-
try {
12-
const obj = typeof response.Result === "string" ? JSON.parse(response.Result) : response.Result;
13-
return obj?.items ?? [];
14-
15-
} catch (error) {
16-
return [];
17-
}
18-
});
19-
}
209
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { IConnection, IOptions } from "../../../../connection";
2+
import { Service } from "../../../../espConnection";
3+
4+
export namespace WsCloud {
5+
6+
export type int = number;
7+
8+
export interface GetPODsRequest {
9+
10+
}
11+
12+
export interface Port {
13+
ContainerPort: int;
14+
Name: string;
15+
Protocol: string;
16+
}
17+
18+
export interface Ports {
19+
Port: Port[];
20+
}
21+
22+
export interface Pod {
23+
Name: string;
24+
Status: string;
25+
CreationTimestamp: string;
26+
ContainerName: string;
27+
ContainerCount: int;
28+
ContainerReadyCount: int;
29+
ContainerRestartCount: int;
30+
Ports: Ports;
31+
}
32+
33+
export interface Pods {
34+
Pod: Pod[];
35+
}
36+
37+
export interface GetPODsResponse {
38+
Pods: Pods;
39+
}
40+
41+
export interface GetServicesRequest {
42+
43+
}
44+
45+
export interface GetServicesResponse {
46+
Result: string;
47+
}
48+
49+
export interface WsCloudPingRequest {
50+
51+
}
52+
53+
export interface WsCloudPingResponse {
54+
55+
}
56+
57+
}
58+
59+
export class CloudServiceBase extends Service {
60+
61+
constructor(optsConnection: IOptions | IConnection) {
62+
super(optsConnection, "WsCloud", "1.02");
63+
}
64+
65+
GetPODs(request: Partial<WsCloud.GetPODsRequest>): Promise<WsCloud.GetPODsResponse> {
66+
return this._connection.send("GetPODs", request, "json", false, undefined, "GetPODsResponse");
67+
}
68+
69+
GetServices(request: Partial<WsCloud.GetServicesRequest>): Promise<WsCloud.GetServicesResponse> {
70+
return this._connection.send("GetServices", request, "json", false, undefined, "GetServicesResponse");
71+
}
72+
73+
Ping(request: Partial<WsCloud.WsCloudPingRequest>): Promise<WsCloud.WsCloudPingResponse> {
74+
return this._connection.send("Ping", request, "json", false, undefined, "WsCloudPingResponse");
75+
}
76+
77+
}

0 commit comments

Comments
 (0)