listAlgo()
Method and interface:
listAlgo(commonReq?: RequestType.RequestConfig): Promise<ULTIPA.Response<ResponseType.Algo[]>>
Example: Acquire information of all installed algorithms
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.listAlgo();
console.log(resp.data);
};
sdkUsage();
installAlgo()
Method and interface:
installAlgo(req: RequestType.InstallAlgo,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<boolean>>
interface InstallAlgo {
paths: {
algoFilePath: string;
infoFilePath: string;
};
}
Example: Install algorithm LPA. The config file 'lpa.yml' and the installation package 'libplugin_lpa.so' are placed under the path of current TS file
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.installAlgo({
paths: {
algoFilePath: "./libplugin_lpa.so",
infoFilePath: "./lpa.yml",
}
});
console.log(resp.status.code_desc);
};
sdkUsage();
uninstallAlgo()
Method and interface:
uninstallAlgo(req: RequestType.UninstallAlgo,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<boolean>>
interface UninstallAlgo {
algoName: string;
}
Example: Uninstall algorithm LPA
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// omit code of establishing server connection 'conn'
let resp = await conn.uninstallAlgo({ algoName: "lpa" });
console.log(resp.status.code_desc);
};
sdkUsage();