"listServices" (JSON Action)
Return information about the specified services
Note
The "listServices" action both lists and describes each service.
When a valid
"authToken"property is present, this action returns all information about each service.When an
"authToken"is omitted, this action returns all information except for the"tls"property.
Links: Concepts | Tutorials | FAQs
Request examples
Retrieve service information that does not require authorization
{
"api": "admin",
"action": "listServices",
"params": {}
}Retrieve extensive service information
{
"api": "admin",
"action": "listServices",
"params": {},
"authToken": "replaceWithAuthTokenFromCreateSession"
}{
"api": "admin",
"action": "listServices",
"params": {},
"requestId": "2",
"apiVersion": "1.0",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Note
FairCom Edge has more services than FairCom DB and the "jsonActionApiDefaults" property has different default settings.
{
"result": {
"listeners": [
{
"serviceName": "http8080",
"description": "Port 8080 using insecure HTTP protocol for REST and Web Apps on all TCP/IP addresses bound to this server",
"enabled": false,
"port": "8080",
"protocol": "http"
},
{
"serviceName": "https8443",
"description": "Port 8443 using TLS-secured HTTPS protocol for REST and Web Apps on all TCP/IP addresses bound to this server",
"enabled": true,
"port": "8443",
"protocol": "https",
"tls": {
"certificateFilename": "./web/fccert.pem"
}
},
{
"serviceName": "mqtt1883",
"description": "Port 1883 using insecure MQTT protocol for the MQTT broker on all TCP/IP addresses bound to this server",
"enabled": true,
"port": "1883",
"protocol": "mqtt"
},
{
"serviceName": "mqtts8883",
"description": "Port 8883 using TLS-secured MQTTS protocol for the MQTT broker on all TCP/IP addresses bound to this server",
"enabled": true,
"port": "8883",
"protocol": "mqtts",
"tls": {
"certificateFilename": "./web/fccert.pem"
}
},
{
"serviceName": "mqttws9001",
"description": "Port 9001 using WebSocket protocol for the MQTT broker on all TCP/IP addresses bound to this server",
"enabled": true,
"port": "9001",
"protocol": "mqttws"
},
{
"serviceName": "mqttwss9002",
"description": "Port 9002 using TLS-secured WebSocket protocol for the MQTT broker on all TCP/IP addresses bound to this server",
"enabled": true,
"port": "9002",
"protocol": "mqttwss",
"tls": {
"certificateFilename": "./web/fccert.pem"
}
},
{
"serviceName": "ISAM",
"enabled": false,
"port": "FAIRCOMS",
"protocol": "isam"
},
{
"serviceName": "SQL",
"enabled": false,
"port": "6597",
"protocol": "sql"
}
],
"jsonActionApiDefaults": {
"defaultApi": "hub",
"defaultBinaryFormat": "hex",
"defaultDatabaseName": "faircom",
"defaultDebug": "max",
"defaultOwnerName": "admin",
"defaultResponseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number",
"variantFormat": "json"
},
"idleConnectionTimeoutSeconds": 3600,
"idleCursorTimeoutSeconds": 600
},
"applicationRoot": "./web/apps/",
"applications": [
{
"serviceName": "Ace Monitor",
"serviceLibrary": "ctmonitor.dll",
"enabled": true,
"uriPath": "AceMonitor"
},
{
"serviceName": "Data Explorer",
"serviceLibrary": "ctsqlexplorer.dll",
"enabled": true,
"uriPath": "SQLExplorer"
},
{
"serviceName": "ISAM Explorer",
"serviceLibrary": "ctisamexplorer.dll",
"enabled": true,
"uriPath": "ISAMExplorer"
},
{
"serviceName": "Rest CRUD",
"serviceLibrary": "ctrest.dll",
"enabled": true,
"uriPath": "ctree"
},
{
"serviceName": "api",
"enabled": true,
"uriPath": "api"
}
],
"apis": [
{
"serviceName": "hub",
"enabled": true
},
{
"serviceName": "mq",
"enabled": true
},
{
"serviceName": "db",
"enabled": true
}
],
"integrationServices": [
{
"serviceName": "opcua",
"serviceLibrary": "opcservice.dll",
"enabled": true
},
{
"serviceName": "modbus",
"serviceLibrary": "modbusservice.dll",
"enabled": true
}
],
"transformServices": [
{
"serviceName": "siemensUDT2JSON",
"serviceLibrary": "siemensudtservice.dll",
"enabled": false
}
],
"otherServices": [
{
"serviceName": "dbnotify",
"serviceLibrary": "./dbnotify/fcdbnotify.dll",
"enabled": false
},
{
"serviceName": "ctagent",
"serviceLibrary": "./agent/ctagent.dll",
"enabled": false
},
{
"serviceName": "thingworx",
"serviceLibrary": "./thingworx/ctthingworx.dll",
"enabled": false
},
{
"serviceName": "aggregation",
"serviceLibrary": "./aggregation/cttimestamp.dll",
"enabled": false
},
{
"serviceName": "cthttpd",
"serviceLibrary": "./web/cthttpd.dll",
"enabled": true
}
]
},
"requestId": "00000006",
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
{
"authToken": "invalidAuthtoken",
"debugInfo": {
"request": {
"authToken": "invalidAuthtoken",
"api": "admin",
"action": "listServices",
"params": {}
}
},
"errorCode": 12031,
"errorMessage": "'authToken' does not match any existing session. Use a valid 'authToken' or use 'createSession' to create a valid 'authToken'."
}
The "listServices" action returns information about the specified services, including a detailed description of each service. When a valid "authToken" is present, it returns all information. If the "authToken" is omitted, it returns all information except for the "tls" property.
The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System limits for a comprehensive overview of property requirements and limitations.
"params" property summariesProperty | Description | Default | Type | Limits (inclusive) | |||
|---|---|---|---|---|---|---|---|
(optional) contains one or more authorization token strings. |
| array | At least one | ||||
(optional) specifies what format the results will be returned in. |
| string enum |
| ||||
(optional) specifies the maximum number of results to return. |
| integer |
| ||||
(optional) specifies the number of results to skip. |
| integer |
|
The "authTokens" property is an array that specifies which sessions the server should return in its response. At least one valid "authToken" must be specified in this property.
{
"api": "admin",
"requestId": "2",
"action": "replaceWithCorrectAction",
"params": {
"authTokens": [
"replaceWithAuthTokenFromCreateSession",
"replaceWithAuthTokenFromCreateSession"
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "maxRecords" is an optional integer from -1 to 65535 that sets the maximum number of records to return from an action. It is used in query actions to paginate the query results when returning records directly. The default for most actions is to return 20 records.
Important
-1 returns all records and should be used very carefully because a large query can return so many records that it eventually times out and wastes server and client resources.
When present,
"maxRecords"works in conjunction with the"skipRecords"(and, when applicable,"reverseOrder") properties to paginate results."maxRecords"returns an error when"returnCursor"istrue.Note
This does not apply to the actions where
"returnCursor"is not present.When returning a cursor, retrieve records using the
"getRecordsFromCursor"action.A value of
0for"maxRecords"is not useful because it causes the action to return no records."maxRecords"is ignored by the"getRecordsByIds"action.
The "skipRecords" property is an optional integer from 0 to 9223372036854775807. It is used in query actions to paginate the query results when returning records directly. It defaults to 0.
It specifies the number of records to skip over in the results before returning records.
It works with
"maxRecords"and"reverseOrder".It is ignored when
"returnCursor"istrue.Note
This does not apply to the actions where
"returnCursor"is not present.
The "result" property is a required object set by the server that contains the result of an action.
"result" property summariesProperty | Description | Type | Contents | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
specifies and controls FairCom's jsonAction APIs. | array of objects | One object for each API. | |||||||||||||||||
| details if the service is enabled. | Boolean |
| ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | A service name between 1 and 64 bytes. | ||||||||||||||||
specifies the base folder where FairCom's web applications are located. | string | The filepath to the folder where FairCom's apps are located. | |||||||||||||||||
specifies and controls FairCom's app servers. | array of objects | One object per application. | |||||||||||||||||
| enables or disables the service. | Boolean |
| ||||||||||||||||
| specifies the filename of the app server's dynamic link library. | string | The file name for the service library. | ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | A service name between 1 and 64 bytes. | ||||||||||||||||
| specifies the endpoint where the app server listens for the requests. | string | The file path for the service library. | ||||||||||||||||
lists the properties that set the JSON action defaults and their current values. | object |
| |||||||||||||||||
| specifies the default value of the | string |
| ||||||||||||||||
| specifies the default value for the | string enum |
| ||||||||||||||||
| specifies the variant format the server uses when the user omits the | string enum |
| ||||||||||||||||
| (optional) specifies the default value of the | string | 1 to 64 bytes | ||||||||||||||||
| specifies the default value of the | string enum |
| ||||||||||||||||
| (optional) specifies the initial value of the | string | 1 to 64 bytes | ||||||||||||||||
| specifies a default value for | object |
| ||||||||||||||||
| specifies how binary values are returned. | string enum |
| ||||||||||||||||
| specifies what format the results will be returned in. | string enum |
| ||||||||||||||||
| specifies how numbers are formatted in the JSON response message. | string enum |
| ||||||||||||||||
| specifies how the server will represent the values of variant fields in its response to your request. | string enum |
| ||||||||||||||||
| specifies how many retention units will be retained if the | integer |
| ||||||||||||||||
| specifies the default way in which messages are persisted if the | string enum |
| ||||||||||||||||
| specifies the default unit of time after which the expired messages will be purged if the | string enum |
| ||||||||||||||||
| specifies the total number of JSON API sessions the app server will accept. | integer |
| ||||||||||||||||
| specifies the number of JSON API sessions the app server will accept from the same client IP address. | integer |
| ||||||||||||||||
| specifies the number of JSON API sessions the app server will accept with the same username. | integer |
| ||||||||||||||||
| enables or disables permanent sessions. | Boolean |
| ||||||||||||||||
| specifies the number of seconds that a session with no activity will stay open. | integer |
| ||||||||||||||||
| specifies the number of seconds to keep a cursor open. | integer |
| ||||||||||||||||
specifies and controls FairCom's integration services. | array of objects | 0 or more objects | |||||||||||||||||
| details if the service is enabled. | Boolean |
| ||||||||||||||||
| specifies the name of the schema. | string | 1 to 64 bytes | ||||||||||||||||
| specifies the filename of the app server's dynamic link library. | string | 1 to 64 bytes | ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | 1 to 64 bytes | ||||||||||||||||
specifies and controls FairCom's listeners. | array of objects | 0 or more objects | |||||||||||||||||
| enables or disables the service. | Boolean |
| ||||||||||||||||
| describes an object for later identification. | string | 0 to 65,500 bytes | ||||||||||||||||
| specifies the port number. | integer | an integer port number | ||||||||||||||||
| specifies the name of a protocol. | string | the name of a protocol | ||||||||||||||||
| specifies the filename of the app server's dynamic link library. | string | 1 to 64 bytes | ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | 1 to 64 bytes | ||||||||||||||||
| specifies optional properties for using TLS to create secure communications. |
| object containing TLS properties | ||||||||||||||||
| specifies an array of ciphers that the server will accept for communications with clients. | string | No limits | ||||||||||||||||
| specifies the name and optional path of the certificate authorities certificate file (such as | string | No limits | ||||||||||||||||
| specifies the name and optional path of a server certificate file (such as | string | No limits | ||||||||||||||||
| specifies the name and optional path of a server key file (such as | string | No limits | ||||||||||||||||
specifies the number of milliseconds the server will wait between attempting the request. | integer |
| |||||||||||||||||
specifies the maximum number of threads allowed in the request. | integer |
| |||||||||||||||||
specifies the maximum number of connections allowed per IP address. | integer |
| |||||||||||||||||
describes and controls FairCom's transform services. | array of objects | 0 or more objects | |||||||||||||||||
| enables or disables the service. | Boolean |
| ||||||||||||||||
| specifies the filename of the app server's dynamic link library. | string | 1 to 64 bytes | ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | 1 to 64 bytes | ||||||||||||||||
specifies which programming languages are available in the product. | array of objects |
| |||||||||||||||||
| enables or disables the service. | Boolean |
| ||||||||||||||||
| specifies the filename of the app server's dynamic link library. | string | 1 to 64 bytes | ||||||||||||||||
| specifies the name of a service that collects data from an external source and inserts it into an integration table. | string | 1 to 64 bytes |
The "apis" property is an array of objects that describes and controls FairCom's jsonAction APIs. It defaults to an empty object.
Each API is a service provided by the FairCom server.
Do not change the settings of the object properties unless you disable an unused API.
The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.
The "applicationRoot" property is a string that specifies the location of web applications relative to <faircom>/server/ .
The default value of "./web/apps/" translates to the folder <faircom>/server/web/apps.
There is rarely a reason to change the "applicationRoot".
For information on how to add your own web applications, which can use any of FairCom's jsonAction APIs, contact FairCom.
The "applications" property is an array of objects that describes and controls web applications that can run with the FairCom server. It defaults to an empty array which means no applications are configured to run.
FairCom and other custom web applications are single-page, browser-based applications served from folders in the default <faircom>/server/web/apps/ folder.
An app server is a backend service used by one or more web applications. It listens to HTTP and/or WebSocket requests and then returns results.
Contact FairCom for information on how to build and add your own app servers using C or C++.
The following "applications" properties should be considered for each web app:
"enabled""serviceName"
The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.
The default settings for the FairCom jsonAction APIs and browser-based applications are specified in the services.json file in the "jsonActionApiDefaults" property.
Note
Use the Google Chrome browser for FairCom browser-based tools. Other browsers may cause unexpected behavior.
"jsonActionApiDefaults": {
"defaultApi": "db",
"defaultBinaryFormat": "hex",
"defaultVariantFormat": "json",
"defaultDatabaseName": "faircom",
"defaultDebug": "max",
"defaultOwnerName": "admin",
"defaultResponseOptions":
{
"binaryFormat": "hex",
"variantFormat": "json",
"dataFormat": "objects",
"numberFormat": "number"
},
"idleConnectionTimeoutSeconds": 3600,
"idleCursorTimeoutSeconds": 600,
"defaultRetentionPolicy":"autoPurge",
"defaultRetentionPeriod":"4",
"defaultRetentionUnit":"week"
}
The property names and values in "jsonActionApiDefaults" are identical to those in the "params" property of "createSession", "alterSession", and "describeSessions". Each FairCom product ships with different default settings that make sense for that product — for example, in FairCom DB, the "defaultAPI" property is set to "db", in FairCom MQ it is set to "mq", and in FairCom Edge it is set to "hub".
You can change the values of the properties in services.json, and all jsonAction APIs and browser-based user interfaces will use these properties as their default. If any of the properties in "jsonActionApiDefaults" are omitted from services.json, the property values may vary depending on the JSON action performed.
Note
FairCom's core configuration file, ctsrvr.cfg, contains a SQL_DATABASE setting. You can set SQL_DATABASE to the name of a database and when the FairCom server starts, it creates a database with that name if it does not already exist.
By default, ctsrvr.cfg sets SQL_DATABASE to "ctreeSQL". If you change SQL_DATABASE to use another database name, it is a good practice to put the same name in the "defaultDatabaseName" property in services.json. This makes your newly created database the default database in all of FairCom's jsonActionAPIs and browser-based applications.
SQL_DATABASE and "jsonActionApiDefaults" in syncctsrvr.cfg
SQL_DATABASE my_new_database
services.json
"": {
"defaultApi": "db",
"defaultBinaryFormat": "hex",
"defaultDatabaseName": "my_new_database",
"defaultDebug": "max",
"defaultOwnerName": "admin",
"defaultResponseOptions":
{
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number"
},
"idleConnectionTimeoutSeconds": 3600,
"idleCursorTimeoutSeconds": 600,
"defaultRetentionPolicy":"autoPurge",
"defaultRetentionPeriod":"4",
"defaultRetentionUnit":"week"
}
The default settings for the FairCom JSON Action APIs and browser-based applications are specified in the services.json file in the "jsonActionApiDefaults" property
The "defaultApi" property specifies the default value of the "api" property when it is omitted from an action request. The default value for "defaultApi" is "admin", which is the API used by all session actions.
"params": {
"username": "CHANGE",
"password": "CHANGE",
"description": "optional user description of session for troubleshooting",
"defaultApi": "db",
"defaultDebug": "max",
"defaultDatabaseName": "ctreeSQL",
"defaultOwnerName": "admin",
"defaultBinaryFormat": "hex"
},The "defaultVariantFormat" property sets the default value of the "variantFormat" property when a JSON Action request does not include it.
The "defaultDatabaseName" property is an optional string that specifies which database name to use when the "databaseName" property is omitted.
"params": {
"username": "CHANGE",
"password": "CHANGE",
"description": "optional user description of session for troubleshooting",
"defaultApi": "db",
"defaultDebug": "max",
"defaultDatabaseName": "ctreeSQL",
"defaultOwnerName": "admin",
"defaultBinaryFormat": "hex"
},"defaultDebug" is an optional string that defines the default value of the "debug" property for all requests in a session. It defaults to "max".
Important
This is different than the "debug" property in that the "debug" property can be universally used in any action while the "defaultDebug" property is only set in the "createSession" action and sets the "debug" property for any action run using the session being created.
Possible values include:
"none""max"
If
"defaultDebug"is omitted or set tonull, it defaults to"max".This causes the server to include the
"debugInfo"property in the response.This setting is typically used in development environments and for temporarily troubleshooting issues in production environments.
For maximum performance set
"defaultDebug"to"none".This causes the server to omit the
"debugInfo"property in the response.This setting is typically used in production and staging environments where it is desirable to have maximum performance and minimal network traffic.
The optional "defaultOwnerName" property is is used by "createSession" and "alterSession" to specify the default owner of objects created by the session. Its value must be a valid username of an account. If it is omitted, null, or "" , it defaults to the value of the session's "username" property.
See Object owner in the JSON DB Concepts section for an explanation of how to use the
"defaultOwnerName"and"ownername"properties to specify the owner of objects.When
"ownerName"is omitted the server uses the"defaultOwnerName"property value set during login.In
"createSession"and"alterSession"when"defaultOwnerName"is omitted or set tonull:In the JSON DB API, the server sets
"defaultOwnerName"to the"username"of the logged-in user. Thus, by default, the logged-in account owns the objects it creates.In the JSON Hub API and JSON MQ API, the server sets
"defaultOwnerName"to"admin"allowing the server to own the objects it creates.
Actions that create objects, such as
"createTable"and"createIntegrationTable", can omit the"ownerName"property making the server set"ownerName"to the value of"defaultOwnerName".When an action that creates an object sets the
"ownerName"property to a valid account name, the specified account owns the created object and an account that owns an object has full management rights over the object. You can use object ownership as a simple way to control access to objects.When
"ownerName"is set to the empty string, then no account owns the object. Unowned objects can be managed by administrator accounts and by accounts assigned to roles that grant access rights to the object making it useful when you want to prevent an account from owning an object and inheriting full management rights to that object.
The "defaultResponseOptions" property is a "responseOptions" object. It defines a default value for "responseOptions" that is used by default in all other action calls. It defaults to an empty object.
JSON NAV allows you to choose how your program detects errors. By default, all error properties are included in each response – unless you override this behavior as shown in the example.
The example omits the error object in all responses which makes it easier for statically typed languages, such as C, C++, Java, C#, and VB, because they prefer properties to always be present. To help these languages, the
"errorCode","errorMessage", and"errorData"properties are always present whether there is an error or not.
Example
"defaultResponseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number",
"variantFormat": "json"
}"variantFormat"
The "variantFormat" property tells the server how to format the values of variant fields in its response to your request.
The "numberFormat" property is an optional, case-insensitive string enum. It defines the format of JSON numbers. The default value for "numberFormat" is the "defaultNumberFormat" defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultNumberFormat" property in the <faircom>/config/services.json file.
When "numberFormat" occurs in "mapOfPropertiesToFields", it tells the server how to encode or decode a number assigned to a JSON property.
For example, including "numberFormat" in a "tableFieldsToJson" transform step controls if the server encodes a number in a JSON property as a number or a number embedded in a string.
"number"This causes the server to return numeric values as JSON numbers, such as
-18446744073709551616.000144722494.This is most efficient.
JSON represents numbers are base-ten numbers that may have any number of digits.
Large numbers, such as
18446744073709551616.000144722494are known to cause problems with JSON parsers and some programming languages, such as JavaScript, which are limited to the smaller range and binary rounding errors of IEEE floating point numbers."string"This returns the server to embed numeric values in JSON strings, such as
"18446744073709551616.000144722494".This is slightly less efficient because it includes two extra double quote characters
Returning numbers embedded in strings ensures JSON parsers and programming languages will not automatically convert the number to a numeric representation that loses precision, introduces rounding errors, truncates values, or generates errors. This allows your application to control how numbers are processed.
Omitted or set to
nullThis defaults to
"number".
Example request
{
"action": "someAction",
"responseOptions":
{
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "variantFormat" property tells the server how to interpret the variant data included in a JSON Action request.
The "defaultRetentionPeriod" property specifies how many retention units will be retained if the "retentionPeriod" property is omitted. It is used in tandem with "defaultRetentionUnit", the retention period describing how many units, and the retention unit describing what kind of unit of measurement. For example, if the "defaultRetentionPeriod" is set to 4, and the "defaultRetentionUnit" is set to "week", the server will purge messages once 4 weeks have passed by default.
"params": {
"defaultRetentionPolicy": "autoPurge",
"defaultRetentionUnit": "week",
"defaultRetentionPeriod": 4
},The "defaultRetentionPolicy" property specifies the default way in which messages are persisted if the "retentionPolicy" property is omitted. Using this property, you can configure messages to persist indefinitely, be purged according to the retention unit and period, or be immediately purged by default.
"params": {
"defaultRetentionPolicy": "autoPurge",
"defaultRetentionUnit": "week",
"defaultRetentionPeriod": 4
},The "defaultRetentionUnit" property specifies the type of retention unit if the "retentionUnit" property is omitted. It is used in tandem with "defaultRetentionUnit", the retention period describing how many units, and the retention unit describing what kind of unit of measurement. For example, if the "defaultRetentionPeriod" is set to 4, and the "defaultRetentionUnit" is set to "week", the server will purge messages once 4 weeks have passed by default.
"params": {
"defaultRetentionPolicy": "autoPurge",
"defaultRetentionUnit": "week",
"defaultRetentionPeriod": 4
},The "maxJsonApiSessions" property is the total number of JSON API sessions the app server will accept. This setting ensures the server does not consume so many resources that it becomes unstable.
The default value is the maximum number of JSON API connections allowed by the license.
A value of 0 disables this protection and allows JSON API sessions up to the maximum number of connections allowed by the license file.
This property is added to the "jsonActionApiDefaults" object.
The "maxJsonApiSessionsPerIpAddress" property is the number of JSON API sessions the app server will accept from the same client IP Address.
The default value is 50.
The maximum possible number of connections is determined by the license file.
A value of 0 disables this protection and allows JSON API sessions with the same IP Address up to the maximum number of connections allowed by the license file.
This property is added to the "jsonActionApiDefaults" object.
In the case that your connections are routed through a firewall or load balancer, you may need to disable this feature since the connections will come from the same IP address.
The "maxJsonApiSessionsPerUsername" property is the number of JSON API sessions the app server will accept with the same username. Because of this, an application may use a different account for each JSON API session.
The default value is 50.
The maximum possible number of connections is determined by the license file.
A value of 0 disables this protection and allows unlimited sessions with the same username up to the maximum number of connections allowed by the license file.
If your application uses one account for all JSON API sessions, this feature will need to be disabled.
This property is added to the "jsonActionApiDefaults" object. See the example below.
Example
"jsonActionApiDefaults":
{
"maxJsonApiSessions": 500,
"maxJsonApiSessionsPerIpAddress": 20,
"maxJsonApiSessionsPerUsername": 20,
"defaultApi": "hub",
"defaultBinaryFormat": "hex",
"defaultDatabaseName": "faircom",
"defaultDebug": "max",
"defaultOwnerName": "admin",
"defaultResponseOptions":
{
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number"
},
"idleConnectionTimeoutSeconds": 3600,
"idleCursorTimeoutSeconds": 600,
"defaultRetentionPolicy": "autoPurge",
"defaultRetentionUnit": "week",
"defaultRetentionPeriod": 4
}The "enablePermanentJsonApiSessions" property enables or disables permanent sessions. When set to false, permanent sessions cannot be created.
The "idleConnectionTimeoutSeconds" property is an optional integer from 0 to 2147483647. It is the number of seconds that a session with no activity will stay open.
A value of 0 keeps a session open indefinitely.
The "idleCursorTimeoutSeconds" property is an optional integer from 0 to 2147483647. It is the number of seconds to keep a cursor open.
Each time a cursor retrieves records, the cursor timer restarts.
A value of
-1keeps a cursor open indefinitely.A value of
0immediately closes a cursor after the current operation.
The "integrationServices" property is an array of objects that describes and controls FairCom's integration services. It defaults to an empty array.
An integration service is a connector that uses a protocol to collect information from devices and/or deliver information to devices — for example, FairCom Edge includes connectors that collect data from Modbus and OPC UA.
For information on how to build and add your own connectors using C or C++, contact FairCom.
Do not change the settings of the object properties unless disabling an unused connector.
The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "schemaName" property is an optional string from 1 to 64 bytes that specifies the unique name of the account that owns an object. The default value is the "username" of the logged-in account.
About
"schemaName":If the
"schemaName"property is omitted, set to"", ornull, the server uses the default schema name supplied at login (if any) or uses the user’s username as the schema name.For legacy support,
"schemaName"can be"", which means a table has no schema.
About how schemas work:
If there is no table with the specified schema name, but there is a table that does not belong to any schema, it belongs to all schemas and that table will match. A table can belong to one schema or all schemas, but not more than one schema.
The fully qualified name of an object includes
"databaseName","schemaName", and the object's name, such as"tableName".Queries and scripts are often written without specifying
"databaseName"and/or"schemaName". This allows queries and scripts to work properly when run in different databases or in different schemas.The default database name is supplied by the
"defaultDatabaseName"property, and the default schema name is supplied by the"defaultSchemaName"property.
The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.
The "listeners" property is an array of objects that describes and controls FairCom's listeners. It defaults to an empty array.
A listener is a service that listens on a specified TCP/IP port for a specified protocol.
FairCom servers provide listeners for the protocols:
"http""https""mqtt""mqtts""mqttws""mqttwss"
Each protocol is hardwired to a specific set of backend services:
The
HTTPandHTTPSprotocols are hardwired to support the jsonAction APIs and web applications.The MQTT and MQTTS protocols are hardwired to support MQTT protocols 3.1.1 and 5.0 over TCP/IP.
The MQTTWS and MQTTWSS protocols are hardwired to support MQTT protocols 3.1.1 and 5.0 over WebSocket.
For information on how to build and add your own listeners using C or C++, contact FairCom.
Do not change the object property settings unless disabling an unused listener.
Each protocol can listen with TLS authentication for secure communications.
The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "description" property is an optional string that describes an object so that you can later find and identify it.
The "port" property is an integer that specifies the port number.
The "protocol" property is a string that specifies the name of a protocol.
The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.
The "tls" property is a JSON object that defines the public server certificate filename, the private key filename, the certificate authority filename, the cipher suites that are allowed, and whether the client certificate is required. This property is optional. It defaults to an empty object.
Example
"tls": { "serverCertificateFilename": "server.crt", "privateKeyFilename": "server.key", "caCertificateFilename": "ca.crt", "allowedCipherSuites": "AES256-SHA256" "requireClientCertificate": "true"
} "tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "certificateFilename" property is an optional string that specifies the name and optional path of a server certificate file.
"tls": {
"allowedCipherSuites": "",
"certificateAuthoritiesFilename": "",
"certificateFilename": "",
"privateKeyFilename": ""
},The "privateKeyFilename" is an optional string that specifies the name and optional path of a server key file.
"tls": {
"allowedCipherSuites": "",
"certificateAuthoritiesFilename": "",
"certificateFilename": "",
"privateKeyFilename": ""
},The "requestIterationMilliseconds" property specifies the number of milliseconds the server will wait between attempting the request.
The "requestMaxThreads" property specifies the maximum number of threads allowed in the request.
The "maxConnectionsPerIpAddress" property is the number of TCP/IP connections the app server will accept from a single TCP/IP address.
This feature is implemented at the FairCom App Server level to prevent the app server from being overwhelmed by a DoS attack. It protects against simultaneous DoS attacks across multiple protocols: HTTP, HTTPS, MQTT, MQTTS, WS, and WSS.
The default is 25 connections.
A value of 0 disables this protection.
This property can be added to the top level of the services.json file and/or to each listener object in the "listeners" array. At the top level, the property applies to all listeners. Within a listener, it applies only to that listener.
In the case that your connections are routed through a firewall or load balancer, you may need to disable this feature since the connections will come from the same IP address.
Example
{
"maxConnectionsPerIpAddress": 5,
"listeners": [
{
"serviceName": "https8443",
"description": "Port 8443 using TLS-secured HTTPS protocol for REST and Web Apps on all TCP/IP addresses bound to this server",
"port": 8443,
"protocol": "https",
"enabled": true,
"maxConnectionsPerIpAddress": 5,
"tls": {
"certificateFilename": "./web/fccert.pem"
}
}
]
}The "otherServices" property is an optional array of objects that describes and controls FairCom's other services. It defaults to the services connected when the server last started up.
"otherServices": [
{
"serviceName": "dbnotify",
"serviceLibrary": "./dbnotify/fcdbnotify.dll",
"enabled": false
}
],The "transformServices" property is an optional array of objects that describes and controls FairCom's transform services. It defaults to the services connected when the server last started up.
"transformServices" [
{
"serviceName": "siemensUDT2JSON",
"serviceLibrary": "siemensudtservice.dll",
"enabled": true
}
],The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.
The "codeServices" property is an optional array of objects that specifies which programming languages are available in the product.
The "enabled" property is an optional Boolean that specifies whether or not the feature is enabled. The example below enables the TLS feature.
"tls": {
"enabled": true,
"caCertificateFilename": "ca.crt",
"allowedCipherSuites": "",
"clientCertificateEnabled": true,
"clientCertificateFilename": "admin_client.crt",
"clientPrivateKeyFilename": "admin_client.key"
}The "serviceName" property contains the name of a FairCom input or output service. This property is required.
See the "params" topic of each specific service for the requirements of this property.
"MODBUS""SIEMENSUDT2JSON""OPCUA"
Note
The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.
Note
MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.