I'm building a simple dataset to programmatically retrieve dynamic information from the Prognosis REST API.
I need to filter the data using nodegroups, based on a variable I'll provide upon request. The nodegroup where the data will be taken from is a concatenated string comprised of hardcoded strings and the variable.
Here is an example to make it clearer:
<dataSet> <id>getcmaphone</id> <query>SELECT * FROM CMAPHONE WHERE DEVICENAME CONTAINS 'SEP' NODE '#Customers\@Customer\Cisco\CUCM\'</query> </dataSet>
Prognosis seems unable to properly replace the variable in the nodegroup
I get the following error when I try to retrieve this dataset:
Failed to get response from PQL: Unknown node group... #Customers\@Customer\Cisco\CUCM\.
I tried the same thing using irpqlcli, I get the same kind of error.
Would anyone know how I can use this variable as part of the NODE statement?
Thank you for your query.
I see that you're trying to use the parameter in the node clause, but what you're trying to vary is just the customer name within the #Customers node group.
Parameters can be used in the node clause, but it cannot be partial like that. If you want, you can change the query like this:
<dataSet> <id>getcmaphone</id> <query>SELECT * FROM CMAPHONE WHERE DEVICENAME CONTAINS 'SEP' NODE @NodeGroupPath</query> </dataSet>
And, then for the REST API, you can substitute NodeGroupPath with #Customer\MyCustomerName\Cisco\CUCM, like this example below (with proper URL encoding):
Let me know if you still encounter issues.