Skip to main content

"describeOutputs" (JSON Action)

JSON hub "describeOutputs" action returns all available information about each specified FairCom Edge output

The "describeOutputs" action returns all available information about each specified output. Outputs deliver tags from the server to external systems.

Note

A tag is a piece of named data with an associated value. For example, the tag temperature 70 includes both the named data temperature and the value 70. In JSON, a tag is a JSON property, such as "temperature": 70. In a SQL table, a tag is a data field, such as a field named temperature with a value of 70.

Request examples

Minimal

{
  "api":        "hub",
  "apiVersion": "1.0",
  "requestId":  "optionalUniquerequestIdFromTheClient",
  "action":     "describeOutputs",
  "params":     {
    "outputNames": [ "AcmefactoryLine1Station1AcidbathTelemetryOutput" ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}      
{
    "result": {
        "data": []
    },
    "requestId": "00000006",
    "errorCode": 0,
    "errorMessage": ""
}

Use the describeOutputs JSON API action to return all available information about each specified FairCom Edge output

JSON hub APIAPI actionsJSON Actionoutput actionsdescribe outputdescribeOutputs

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.

Table 1. describeOutputs "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

dataFormat

specifies the format of data being set to the server

"autoDetect"

string enum

"autoDetect"
"arrays"
"objects"

outputNames

(optional) contains "outputName" strings.

[]

array

1 or more strings



The "dataFormat" property is an optional, case-insensitive string enum. It defines the format of data being sent to the server. "autoDetect" is the default value.

Note

There are two different but similar versions of the "dataFormat" property. One version occurs in a request, and the other occurs in a response.

Possible values:
  • "arrays" specifies that the "sourceData" is an array of arrays, which is most efficient.

  • "objects" specifies that the "sourceData" is an array of objects. This is less efficient but is simpler to generate, read, and troubleshoot.

  • "autoDetect" instructs the server to automatically detect the format of the data in the "sourceData" property. This is the default.

  • Omitted or set to null defaults to "autoDetect",

The "outputNames" property is an array of strings, each specifying the name of an output. The response will include details about all outputs with an "outputName" that matches one of the strings in the array.

"result"

Table 2. describeOutputs "result" property summaries

Property

Description

Type

Limits (inclusive)

databaseName

(optional) specifies the name of a database.

string

1 to 64 bytes

metadata

(optional) exists primarily for the user interface to find integration information.

object

May contain any number and type of user-defined properties

outputName

(optional) specifies a unique name for mapping of an integration table to an output plugin to an external system.

string

1 to 64 bytes

ownerName

(optional) specifies the name of the owner.

string

1 to 64 bytes

serviceName

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

"modbus"
"opcua"
"rest"
"thingWorx"

settings

(optional) contains properties needed to configure the data source of the specified plugin.

object

"body"
"host"
"uri"
settings
.body

(optional) specifies information to send to a REST server.

array of objects

"propertyPath"
"propertyValue"
settings
.body
.propertyPath

specifies the name of the data to be defined by "propertyValue".

string

0 to 256 bytes

settings
.body
.propertyValue

specifies an array of properties that define the data of a named "propertyPath".

object

"fromConstant": "yourString"
"fromSourcePropertyPath": { "key": "value"}
settings
.host

specifies the IP or hostname of the Rest resource, including port.

string

1 to 1024 bytes

settings
.uri

specifies the identifier name of the REST resource.

string

1 to 1024 bytes

sourceDataField

(optional) specifies the field that the MQTT Subscription engine should use as the payload when it sends the payload to subscribers.

string

"source_payload"
"t1"
"t2"
"t3"
"t4"
"t5"
"t6"
"t7"
"t8"
"t9"

sourceDataFormat

(optional) specifies the format of the "source_payload" field.

string enum

"json"
"xml"
"binary"
"jpeg"
"siemensUdt"

sourceFields

(optional) specifies the fields the FairCom server makes available to the output connector.

array

One or more fields from the integration table.

tableName

(optional) specifies the name of a table.

string

1 to 64 bytes



The "databaseName" property is an optional string that specifies the database that contains the tables. It defaults to the database name supplied at login.

Note

In the API Explorer, "defaultDatabaseName" is set to "ctreeSQL" in the "createSession" action that happens at login.

  • A zero-length "databaseName" is invalid.

  • Its length limit is from 0 to 64 bytes.

  • If the "databaseName" property is omitted or set to null, the server will use the default database name specified at login.

  • If no default database is specified during "createSession", "databaseName" will be set to the "defaultDatabaseName" value that is specified in the services.json file.

"params": {
  "databaseName": "mainDatabase"
  }

The "metadata" property is an optional JSON object. It exists primarily for the user interface to find integration information. By default, it is an empty JSON object.

  • It contains a flexible set of properties.

  • It typically contains tags and description properties.

Example

{
  "description": "",
  "tags": [""],
  "yourOwnProperties": "usage, purpose, notes, location, etc.",
}

The "outputName" property is an optional string that specifies a unique name for mapping an integration table to an output plugin to an external system.

  "params": {
    "outputName": "AcmefactoryLine1Station1AcidbathTelemetryOutput"
  }

The "ownerName" property is an optional string from 1 to 64 bytes that identifies the user who owns an object (see Object owner). If it is omitted or set to "" or null, the server uses the default owner name supplied during the "createSession" action or uses the account's "username" as the owner name.

"params": {
  "ownerName": "SuperUser"
}

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.

The following services are available as of the V5 release:
  • "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.

Table 3. "settings" property summaries

Property

Description

Default

Type

Limits

host

contains the IP or hostname of the Rest resource, including the port

Required - No default

string

uri

contains the identifier name of the REST resource

Required - No default

string

headers

contains additional information about the request. It is a list of elements with the key-value format

""

List of strings with the format key: value

body

contains information to send to a REST server.

[]

array of objects

body
.propertyPath

specifies the name of data to be defined by "propertyValue".

[Required]

No default

string

body
.propertyValue

contains an array of properties that define the data of a named "propertyPath".

[Required]

No default.

object

threshold

contains properties that define the threshold for sending a REST command



The "body" property specifies information to send to a REST server by defining the "propertyPath" and "propertyValue" properties.

    "settings": {
        "body": {
            "propertyPath": "humidity",
            "propertyValue": {"fromConstant": "0002"}
        },
        "uri": "identifier name",
        "host": "hostname and port"
    }

The "propertyPath" property specifies the name of the data to be defined by "propertyValue".

      "body": [
        {
          "propertyPath": "Temperature",
          "propertyValue": {
            "fromSourcePropertyPath": {
              "formatString": "<%temperature%>"
            }
          }
        }
      ]

This is a required object that contains properties that define the data values of a "propertyPath". It is required and has no default value.

The data values specified in the "propertyValue" object can be a string or an object.

  • "fromConstant" indicates the value is a string. For example —

    "propertyValue": {"fromConstant": "0002"}

  • "fromSourcePropertyPath" indicates the value is an object. For example —

    "propertyValue": {"fromSourcePropertyPath": { "formatString": "Temperature = <%input_temp%>" }}

    Characters in the "formatString" value that are enclosed by "<%" and "%>", specify the name as an input property that will be replaced by an input property value.

    Here is a REST command example for the "propertyPath" named "description", that received an input_temp value of 103:

    {  description: "Temperature = 103."}

    If the input value is not found, it is replaced with NULL:

    {  description: "Temperature = NULL."}

The "host" property specifies the IP or hostname of the Rest resource, including the port.

    "settings": {
        "body": {
            "propertyPath": "humidity",
            "propertyValue": {"fromConstant": "0002"}
        },
        "uri": "identifier name",
        "host": "hostname and port"
    }

The "uri" property specifies the identifier name of the Rest resource.

    "settings": {
        "body": {
            "propertyPath": "humidity",
            "propertyValue": {"fromConstant": "0002"}
        },
        "uri": "identifier name",
        "host": "hostname and port"
    }

The "sourceDataField" property is an optional string that contains the name of a field from an integration table. It defaults to "source_payload".

The "sourceDataFormat" property specifies the format of the "source_payload" field. You can set this property to any of the following values:

  • "json"

  • "xml"

  • "binary"

  • "jpeg"

  • "siemensUdt"

  "params": {
    "sourceDataField": "t2",
    "sourceDataFormat": "JSON",
    "sourceFields": [
      "source_payload"
    ],

The optional "sourceFields" property specifies the fields the FairCom server makes available to the output connector. The server creates a JSON object from the fields you specify, and the output connector uses it as its source data. If "sourceFields" is omitted, set to null or [], the FairCom server defaults to creating a JSON document that contains all fields from the integration table. This default allows the output connector to send data to a device from any field in the table.

An integration table has many fields, such as fields populated by transforms and MQTT. Converting all fields into JSON is slower than converting only the fields needed by the output connector. For example, input connectors and MQTT messages store their data in the source_payload field. You can use "sourceFields": ["source_payload"] to make only the source_payload field available to the output connector.

When you configure an output connector, you add propertyMap objects to the "propertyMapList". Each propertyMap object extracts data from one field and writes that data to the connected device. The value of the "propertyPath" property is a string containing the path of the data. It always starts with a field name in the "sourceFields" property. For example, if "sourceFields" is set to ["pressure"], then you must set "propertyPath" to "pressure" to use the pressure field’s value in your output. If the value you want to extract is a JSON property nested inside a field, you must add its full path to the "propertyPath". For example, if "sourceFields" is set to ["source_payload"] and source payload contains a JSON object with a "temperature" property, then you must set "propertyPath" to "source_payload.temperature".

The "tableName" property contains the name of the table in the database where the event occurred. It is a non-zero-length string.

See table name in System limits for table naming requirements and limitations.

A table in DBnotify is defined by "databaseName", "ownerName" and "tableName" or by "dataFilePath".