/Things/Concentrator/ExecuteQuery (extension)
Executes a query on a node.
Use the following asynchronous method in the Javascript Library, to call this resource.
var Response = await AgentAPI.Things.Concentrator.ExecuteQuery(JID,Language,Command,Parameters,NodeId,SourceId[,Partition[,DeviceToken[,ServiceToken[,UserToken]]]]);
Input Arguments
| Parameter | Description |
|---|---|
JID |
JID of the concentrator. If a Bare JID, the function will attempt to get the Full JID before performing the query. |
Language |
The ISO Language code to use when returning localized strings. |
Command |
Command ID of the query on a node on the concentrator. |
Parameters |
Parameters object to send to command. Can be same or reduced object, as the one retrieved using GetCommandParameters() |
NodeId |
Node ID of the node on the concentrator. |
SourceId |
Source ID of the data source on the concentrator. |
Partition |
Optional partition of the data source in which the node identity is unique on the concentrator. |
DeviceToken |
Optional device token(s) (delimited by space characters), identifying the device(s) where a distributed transaction originated. |
ServiceToken |
Optional service token(s) (delimited by space characters), identifying the service(s) where a distributed transaction originated. |
UserToken |
Optional user token(s) (delimited by space characters), identifying the user(s) where a distributed transaction originated. |
Note: To send an information query to a connected device, you need its Full JID. If you provide a Bare JID, the library call will attempt to get the Full JID for you. To avoid such call each time you need to make such a call, you can get the Full JID yourself, by calling await AgentAPI.Things.XmppHelper.GetFullJid(JID). To be able to get the Full JID, you need to have an approved presence subscription to the device’s Bare JID. To send a presence subscription call AgentAPI.Xmpp.SendPresenceSubscription.
Note 2: When sending a Parameters object to the method, it is not necessary to send a full Form object definition. It is sufficient the object has the field array, with each field having the type and var properties preserved, and the value property defined with the value you want to set.
Response
The response will contain the Query object containing the result of the query.
Note: A node might exist on the concentrator, invisible to the caller, if the caller does not have the right to see it. In such cases, all calls to the concentrator will return values as if the node did not exist. Likewise, commands the caller does not have the right to see, will not appear.