Query end points the listeners within TQLEngine A-Stack which is ready to take any TQL Query requests (CRUD Queries) and send the response back to the user.
Query endpoints are generated when TQL Facet type is instantiated using NewFacetInstance as part of package definition. The format of the published endpoint is below:
Format of Published Endpoint
There are two end points created with standard project deployment (defined in package definition)
http://<hostname>:<portnumber>/fid-<Project facet Id>
This end point takes all TQL Queries as request-response
ws://<hostname>:<portnumber>/fid-<Project facet Id>WS
This end point takes all subscription queries and publishes messages asynchronously against the subscriptions.
In addition to northbound end points for applications, there are additional end points, which come out of the box from the engine to communicate with southbound devices.
Supported Protocol Handler
Protocol name | Protocol Prefix |
---|---|
HTTP/S | http:// |
Peripheral | perif:// |
Phidget | phid:// |
UCAM | ucam:// |
Bluetooth / BLE | blth:// |
Websocket | ws:// |
Query end points are defined in the mqp file.
When you deploy or export a project from TQLStudio, it automatically generate the mqp file for you, which defines two query end points:
http:// - for all queries except subscription. This is synchronous
ws:// - subscription is always sent and received from the WebSocket channel. Asynchronous
Describe the common structure of a query end point, which contains the facet ID
...
Example of Published Query Endpoint
Facet Type Name | SffTqlFacet | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Language Support | Thing Interaction Language (TIL) - TQL CRUD Queries requested via <Query> tag. | |||||||||
Transports | HttpServerExtensionArgs WsServerExtensionArgs | |||||||||
Usage | Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.
| |||||||||
Endpoint Generated | ws://<HostName>:<PortNumber>/fid-samplequeries Where PortNumber is the port on which A-Stack is started and <HostName> is the engine machine IP address |
TQLStudio
When models are built using Model Editor and deploy to A-Stack in the cloud or the project imported into local A-Stack, the Query endpoints are automatically generated because of the fixed package definition. The endpoints are unique for each project. This could be one way to protect your endpoints for unauthorized access.