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)
...
Supported Protocol Handler
Protocol name | Protocol Prefix |
---|
HTTP/S | http:// |
Peripheral | perif:// |
Phidget | phid:// |
UCAM | ucam:// |
Bluetooth / BLE | blth:// |
Websocket | ws:// |
...
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. |
---|
xmlruby | title | SffTqlFacet Example |
---|
linenumbers | true |
---|
|
|
<!--# Typical TQL Facet Definition
|
|
-->
<NewFacetInstance fid=NewFacetInstance(fid: "samplequeries", |
|
==> <OnActivate><!--# Associate other facet types; Either Private or Public Instances |
|
-->
<NewFacetInstance name=
NewFacetInstance(name: "tqlwfws", type |
|
= /> <!--) # Private Instance of wdl facet
|
|
-->
<NetworkFacet>?cluster</NetworkFacet> <!-- NetworkFacet: "?cluster" # Public Instance of Network Facet |
|
-->
<TopicFacet>?TQLGenericTopic</TopicFacet> <!--
TopicFacet: "?TQLGenericTopic" # Public Instance of Topic Facet |
|
-->
<ImportFacet>
ImportFacet:
[:RuntimeParams.MacroFacetID:] |
|
</ImportFacet> <!-- # Private Instance of Msg facet |
|
-->
<Process><!--# Define TQL Storage Scheme |
|
-->
<Storage Name=
Storage(Name: "[:RuntimeParams.TQLCacheName:]", Type |
|
= Comment=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
Namespace:
Include: cloud.dbm.xml
OnOpen(ModifyPipeline: "WsServerExtensionArgs")
OnRequest:
#HandOff the request to Facet |
|
-->
<Process Return="CMD_NOP">
<Message>
<Value>
<Include>$Request.Message.Value</Include>
</Value>
</Message>
</Process>
</DoRequest>
<DoResponse> <!--
DoRequest:
Process Return: "CMD_NOP"):
Message:
Value:
Include: $Request.Message.Value
DoResponse: # Process the response from Facet or send it straight through |
|
-->
<Process>
<Message type=
Process:
Message(type: "[:RuntimeParams.TQLOutputFormat:]" |
|
>
<Value>
<Include>$Response.Message.Value</Include>
</Value>
</Message>
</Process>
</DoResponse>
</OnRequest>
</NewFacetInstance>):
Value:
Include: $Response.Message.Value |
|
Endpoint Generated | ws://<HostName>:<PortNumber>/fid-samplequeries Where PortNumber is the port on which |
---|
TQLEngine A-Stack is started and <HostName> is the engine machine IP address |
TQLStudio
When models are built using Model Editor and deploy to TQLEngine A-Stack in the cloud or the project imported into local TQLEngineA-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.