Hello,
I have a problem with REST API query. I would like to verify a list of network assets in my SolarWinds via REST API. I have applied below query but I got Exception. I filter by Vendor (Type = System.String).
curl -kv -u <credentials> https://<IP>:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Vendor,IPAddress+FROM+Orion.Nodes+WHERE+Vendor='Cisco';
{"Message":"Cannot resolve property Cisco","ExceptionType":"SolarWinds.Data.Query.ParserException","FullException":"SolarWinds.Data.Query.ParserException: Cannot resolve property Cisco\r\n at SolarWinds.Data.Query.Processor.SemanticChecker.HandleNonQualifiedPropertyName(EntityExpression entityExpression)\r\n at SolarWinds.Data.Query.Swql.ParseTreeDuplicator.Visit(BinaryExpression binary)\r\n at SolarWinds.Data.Query.Swql.ParseTreeDuplicatorNoState.Visit(WhereClause where)\r\n at SolarWinds.Data.Query.Processor.SemanticChecker.Visit(SelectStatement statement)\r\n at SolarWinds.Data.Query.Processor.SemanticChecker.Process(SelectStatement statement, PreProcessorState state, String replaceStatementTagWith)\r\n at SolarWinds.Data.Query.Processor.SemanticChecker.Process(SelectStatement statement, PreProcessorState state)\r\n at SolarWinds.Data.Query.Processor.PreProcessor.Process(SelectStatement selectStatement, PreProcessorState& preProcessorState)\r\n at SolarWinds.Data.Query.Engine.QueryProcessor* Connection #0 to host <IP> left intact
.CompileQueryExecutionPlan(String query, IQueryExecutionContext context)\r\n at SolarWinds.InformationService.Core.QueryPlanCache.GetQueryPlan(String query, String username, Boolean federationEnabled, Func`1 buildQueryPlan)\r\n at SolarWinds.InformationService.Core.InformationService.GetQueryExecutionPlan(String query, IIdentity currentIdentity, Boolean federationEnabled, IQueryExecutionContext queryExecutionContext)\r\n at SolarWinds.InformationService.Core.InformationService.RunQuery(String query, IDictionary`2 parameters, IDataSerializer serializer, IMessageFormatterStrategy messageFormatterStrategy)"}
Similar query but this time I try to filter by NodeID (Type = System.Int32) and it works.
curl -kv -u <credentials> https://<IP>:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Vendor,IPAddress+FROM+Orion.Nodes+WHERE+NodeID='18930';
{"results":[{"Vendor":"Cisco","IPAddress":"X.X.X.X"}]}
Where is the problem?