Skip to main content

"alterOutput"

The JSON Edge API "alterOutput" action modifies a FairCom Edge output

Abstract

"alterOutput" alters, changes, modifies, updates, or configures an existing output connector in FairCom Edge. An output connector delivers data automatically to a device or software system.

The "alterOutput" action alters an existing output connector in FairCom Edge to deliver tags automatically to a device or software system. Before you can change an output, you must use "createOutput" to create it.

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.

  • You can change the source field of the integration table that supplies the data for the plugin.

  • You can change the data format of the source field.

  • You can change the settings of an integration.

  • You can change metadata to make the integration easier to locate.

  • You cannot change the plugin or the integration table.

    You will need to create a new integration.

  • An integration connects data in the server to a plugin that delivers data from the server to external systems, such as connecting the integration table populated by OPC UA to the ThingWorx connector.

    Note

    Use "configureTopic" to connect MQTT to an existing integration table.

Request examples

Minimal request example

{
  "api":        "hub",
  "apiVersion": "1.0",
  "requestId":  "00000001",
  "authToken":  "anAuthorizationTokenFromTheServer",
  "action":     "alterOutput",
  "params":     {
    "outputName":      "AcmefactoryLine1Station1AcidbathTelemetryOutput",
    "serviceName":     "THINGWORX",
    "databaseName":    "ctreeSQL",
    "tableName":       "acmefactory_line1_station1_acidbath_telemetry",
    "sourceDataField": "t2"
  }
}
{
  "api":        "hub",
  "apiVersion": "1.0",
  "requestId":  "00000001",
  "authToken":  "anAuthorizationTokenFromTheServer",
  "action":     "alterOutput",
  "params":     {
    "outputName":       "AcmefactoryLine1Station1AcidbathTelemetryOutput",
    "serviceName":      "THINGWORX",
    "databaseName":     "ctreeSQL",
    "tableName":        "acmefactory_line1_station1_acidbath_telemetry",
    "sourceDataField":  "t2",
    "sourceDataFormat": "JSON",
    "metadata":         { },
    "settings":         { }
  }
}

Response examples

Minimal response example

Response example to the minimal request example goes here.
Failed response can go here if listed.
Maximal response example goes here.

"params"

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties.

Property summary

Table 1. "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

databaseName

specifies the name of a database

Defaults to the "defaultDatabaseName" value that is set during "createSession". If no default is set during "createSession", then "faircom" is used.

string

1 to 64 bytes

metadata

exists primarily for the user interface to find integration information

{}

object

May contain any number and type of user-defined properties

outputName

specifies a unique name for mapping of an integration table to an output plugin to an external system

A FairCom generated name that follows the pattern "Output #n from <databaseName>.<schemaName>.<tableName> to <pluginName>"

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

Required - No default value

string

1 to 64 bytes

settings

contains properties needed to configure the data source of the specified plugin

{}

object

sourceDataField

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

Required - No default value

string

1 to 256 bytes

sourceDataFormat

specifies the format of the "source_payload" field

"json"

string

One of the following:

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

tableName

specifies the name of a table

Optional - No default value

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.

Things to know:
  • A zero-length "databaseName" is invalid.

  • Its limits are 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", "defaultDatabaseName" will be set to the "defaultDatabaseName" value that is specified in the services.json file.

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.

Things to know:
  • It contains a flexible set of properties.

  • It typically contains tags and description properties.

Example

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

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.

Property summary

Table 2. "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

Optional

List of strings with the format key: value

"body"

contains information to send to a REST server.

Optional

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 "tableName" property is a string containing the name of an integration table. In FairCom Edge, you can use "createInput" to collect data from a device, and FairCom Edge will store the data in the specified integration table. You can also use "createOutput" to connect an integration table to an output so FairCom Edge will push inserted data to external systems, such as REST endpoints and ThingWorx.

Things to know:
  • A table name may contain up to 64 ASCII characters and must not start with a number.

  • You must specify a non-empty string for an integration table name.

  • When creating an integration table, specify a non-empty string for a table name.

  • FairCom Edge and FairCom MQ automatically create an integration table for each new MQTT topic they process. The first characters in the table name are "mqtt_msg_" followed by the topic name. Because an MQTT topic can be 65500 bytes and a table name can be 64 bytes, the server may abbreviate the topic name.

  • To better identify the data it holds, rename an integration using the "tableName" and "newTableName" properties of the "alterIntegrationTable" action.