Skip to content

Commit

Permalink
feat(comms): Add support for WsSasha
Browse files Browse the repository at this point in the history
Fixes #4219 Comms Layer for WsSasha Added

Signed-off-by: Kunal Aswani <[email protected]>
  • Loading branch information
kunalaswani committed Jul 31, 2024
1 parent 8d7f75b commit 7ffb27c
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/comms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"wsdl-logaccess": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_logaccess?wsdl --outDir=./src/services/wsdl",
"wsdl-machine": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_machine?wsdl --outDir=./src/services/wsdl",
"wsdl-packageprocess": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsPackageProcess?wsdl --outDir=./src/services/wsdl",
"wsdl-sasha": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsSasha?wsdl --outDir=./src/services/wsdl",
"wsdl-smc": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsSMC?wsdl --outDir=./src/services/wsdl",
"wsdl-resources": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_resources?wsdl --outDir=./src/services/wsdl",
"wsdl-store": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsStore?wsdl --outDir=./src/services/wsdl",
Expand Down
1 change: 1 addition & 0 deletions packages/comms/src/index-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from "./services/wsLogaccess";
export * from "./services/wsMachine";
export * from "./services/wsPackageProcess";
export * from "./services/wsResources";
export * from "./services/wsSasha";
export * from "./services/wsSMC";
export * from "./services/wsStore";
export * from "./services/wsTopology";
Expand Down
8 changes: 8 additions & 0 deletions packages/comms/src/services/wsSasha.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { SashaServiceBase, WsSasha } from "./wsdl/WsSasha/v1.01/WsSasha";

export {
WsSasha
};

export class SashaService extends SashaServiceBase {
}
100 changes: 100 additions & 0 deletions packages/comms/src/services/wsdl/WsSasha/v1.01/WsSasha.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { IConnection, IOptions } from "../../../../connection";
import { Service } from "../../../../espConnection";

export namespace WsSasha {

export type unsignedInt = number;

export enum WUTypes {
ECL = "ECL",
DFU = "DFU"
}

export interface ArchiveWURequest {
Wuid?: string;
WUType?: WUTypes;
DeleteOnSuccess?: boolean;
}

export interface Exception {
Code: string;
Audience: string;
Source: string;
Message: string;
}

export interface Exceptions {
Source: string;
Exception: Exception[];
}

export interface ResultResponse {
Exceptions: Exceptions;
Result: string;
}

export interface GetVersionRequest {

}

export interface ListWURequest {
WUType?: WUTypes;
Wuid?: string;
Cluster?: string;
Owner?: string;
JobName?: string;
State?: string;
FromDate?: string;
ToDate?: string;
Archived?: boolean;
Online?: boolean;
IncludeDT?: boolean;
BeforeWU?: string;
AfterWU?: string;
MaxNumberWUs?: unsignedInt;
Descending?: boolean;
OutputFields?: string;
}

export interface WSSashaPingRequest {

}

export interface WSSashaPingResponse {

}

export interface RestoreWURequest {
Wuid?: string;
WUType?: WUTypes;
}

}

export class SashaServiceBase extends Service {

constructor(optsConnection: IOptions | IConnection) {
super(optsConnection, "WSSasha", "1.01");
}

ArchiveWU(request: Partial<WsSasha.ArchiveWURequest>): Promise<WsSasha.ResultResponse> {
return this._connection.send("ArchiveWU", request, "json", false, undefined, "ResultResponse");
}

GetVersion(request: Partial<WsSasha.GetVersionRequest>): Promise<WsSasha.ResultResponse> {
return this._connection.send("GetVersion", request, "json", false, undefined, "ResultResponse");
}

ListWU(request: Partial<WsSasha.ListWURequest>): Promise<WsSasha.ResultResponse> {
return this._connection.send("ListWU", request, "json", false, undefined, "ResultResponse");
}

Ping(request: Partial<WsSasha.WSSashaPingRequest>): Promise<WsSasha.WSSashaPingResponse> {
return this._connection.send("Ping", request, "json", false, undefined, "WSSashaPingResponse");
}

RestoreWU(request: Partial<WsSasha.RestoreWURequest>): Promise<WsSasha.ResultResponse> {
return this._connection.send("RestoreWU", request, "json", false, undefined, "ResultResponse");
}

}
11 changes: 11 additions & 0 deletions tests/test-comms/src/services/wsSasha.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect } from "chai";

import { SashaService } from "@hpcc-js/comms";
import { ESP_URL } from "../testLib";

describe("WsSasha", function () {
it("basic", function () {
const service = new SashaService({ baseUrl: ESP_URL });
expect(service).exist;
});
});

0 comments on commit 7ffb27c

Please sign in to comment.