listAlgo()
方法及相关接口:
listAlgo(commonReq?: RequestType.RequestConfig): Promise<ULTIPA.Response<ResponseType.Algo[]>>
示例:获取所有已安装算法的信息
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// 创建名为conn的连接,此部分代码省略
let resp = await conn.listAlgo();
console.log(resp.data);
};
sdkUsage();
installAlgo()
方法及相关接口:
installAlgo(req: RequestType.InstallAlgo,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<boolean>>
interface InstallAlgo {
paths: {
algoFilePath: string;
infoFilePath: string;
};
}
示例:安装图算法LPA,将配置文件lpa.yml和算法安装包libplugin_lpa.so放在当前ts文件的目录下
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// 创建名为conn的连接,此部分代码省略
let resp = await conn.installAlgo({
paths: {
algoFilePath: "./libplugin_lpa.so",
infoFilePath: "./lpa.yml",
}
});
console.log(resp.status.code_desc);
};
sdkUsage();
uninstallAlgo()
方法及相关接口:
uninstallAlgo(req: RequestType.UninstallAlgo,
commonReq?: RequestType.RequestConfig
): Promise<ULTIPA.Response<boolean>>
interface UninstallAlgo {
algoName: string;
}
示例:卸载算法LPA
import { ConnectionPool } from "@ultipa-graph/ultipa-node-sdk";
let sdkUsage = async () => {
// 创建名为conn的连接,此部分代码省略
let resp = await conn.uninstallAlgo({ algoName: "lpa" });
console.log(resp.status.code_desc);
};
sdkUsage();