...
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. Code Block |
---|
language | xml |
---|
title | SffTqlFacet Example |
---|
linenumbers | true |
---|
| <!-- Typical TQL Facet Definition -->
<NewFacetInstance fid="samplequeries"
Name="TQL" Type="SffTqlFacet">
<OnActivate>
<!-- Associate other facet types; Either Private or Public Instances -->
<NewFacetInstance name="tqlwfws" type="SffWdlFacet" /> <!-- Private Instance of wdl facet -->
<NetworkFacet>?cluster</NetworkFacet> <!-- Public Instance of Network Facet -->
<TopicFacet>?TQLGenericTopic</TopicFacet> <!-- Public Instance of Topic Facet -->
<ImportFacet>[:RuntimeParams.MacroFacetID:]</ImportFacet> <!-- Private Instance of Msg facet -->
<Process>
<!-- Define TQL Storage Scheme -->
<Storage Name="[:RuntimeParams.TQLCacheName:]" Type="SqlSff"
Comment="[:RuntimeParams.TQLCacheName:] Database SFF Unstructured SQL database" />
<!-- Specify the Model Definition file (TDL). Normally consists of Model definitions -->
<Namespace>
<Include>cloud.dbm.xml</Include>
</Namespace>
</Process>
</OnActivate>
<OnOpen ModifyPipeline="WsServerExtensionArgs" />
<OnRequest>
<DoRequest> <!-- HandOff the request to Facet -->
<Process Return="CMD_NOP">
<Message>
<Value>
<Include>$Request.Message.Value</Include>
</Value>
</Message>
</Process>
</DoRequest>
<DoResponse> <!-- Process the response from Facet or send it straight through -->
<Process>
<Message type="[:RuntimeParams.TQLOutputFormat:]">
<Value>
<Include>$Response.Message.Value</Include>
</Value>
</Message>
</Process>
</DoResponse>
</OnRequest>
</NewFacetInstance> |
|
---|
Endpoint Generated | ws://fid-samplequeries:<PortNumber> Where PortNumber is the port on which TQLEngine is started. |
---|
TQLStudio
When models are built using Model Editor and deploy to TQLEngine in the cloud or the project imported into local TQLEngine, 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.