Message 1 of 2
WEB API Running Python API - vrNodeService.findNode() response is <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there, I am using a TypeScript service to call the python api.
I built these methods to do a call to the API and find the node. It is working fine but I getting this serialized object <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0> and when I pass it as a parameter in the function bellow, I actually get 200 but nothing happens.
private static callVredApiPython<T>(command: string, instanceIp: string, region: Region, httpMethod: Method, authToken: string): Promise<T> {
const instanceUrl = VredCoreService.getVredInstanceUrl(instanceIp, region);
instanceUrl.pathname += `/${authToken}/pythoneval2`;
instanceUrl.searchParams.set('value', command);
return RestService.rawAjax<void, T>(instanceUrl.toString(), httpMethod).then((response) => response?.data, RestService.throwErrorFromBackend);
}
public static findNode(instanceIp: string, region: Region, authToken: string, command: string): Promise<Object> {
return VredCoreService.callVredApiPython(command, instanceIp, region, 'GET', authToken);
}
The code that I ran after is in the next block : "toggleNodeVisibility" .
public static toggleNodeVisibility(instanceIp: string, region: Region, authToken: string, nodeObject: Object, isVisible: boolean, childrenAreVisible: boolean): Promise<void> {
const command = `vrScenegraphService.setNodeVisibility([${nodeObject}],${isVisible},recursive=${childrenAreVisible})`;
return VredCoreService.callVredApiPython(command, instanceIp, region, 'GET', authToken);
}