|
| 1 | +import { IConnection, IOptions } from "../../../../connection.ts"; |
| 2 | +import { Service } from "../../../../espConnection.ts"; |
| 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