Skip to main content

"describeIntegrationTables" (JSON Action)

JSON hub "describeIntegrationTable action returns all available information about each specified integration table in FairCom Edge

The "describeIntegrationTables" action returns all available information about each specified integration table.

Request examples

Describe a table

{
  "api": "hub",
  "apiVersion": "1.0",
  "requestId": "optionalUniquerequestIdFromTheClient",
  "action": "describeIntegrationTables",
  "params": {
    "tables": 
    [
      {
        "databaseName": "faircom",
        "ownerName": "admin",
        "tableName": "mqtt_msg_faircomadmin_topics"
      }
    ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
{
  "requestId": "optionalUniqueRequestIdFromTheClient",
  "api": "hub",
  "action": "describeIntegrationTables",
  "params": {
    "tables": [
      {
        "databaseName": "faircom",
        "ownerName": "admin",
        "tableName": "mqtt_msg_faircomadmin_topics"
      }
    ]
  },
  "apiVersion": "1.0",
  "debug": "max",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
{
    "result": {
        "data": [
            {
                "databaseName": "faircom",
                "ownerName": "admin",
                "tableName": "mqtt_msg_faircomadmin_topics",
                "fields": [],
                "retentionPolicy": "autoPurge",
                "retentionPeriod": 30,
                "retentionUnit": "day"
            }
        ]
    },
    "requestId": "00000017",
    "errorCode": 0,
    "errorMessage": "",
    "authToken": "replaceWithAuthTokenFromCreateSession"
}
{
  "result": {


    "transformStatus": "running",
    "transformPercentComplete": 52


  },
  "errorCode": 0,
  "errorMessage": "",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

Use the describeIntegrationTables JSON API action to return all available information about each specified integration table in FairCom edge

JSON hub APIAPI actionsJSON Actionintegration tables actionsdescribe integration tabledescribeIntegrationTables

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. describeIntegrationTables "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

tables

(optional) contains an array of objects [each object identifies a table].

{}

array of objects

0 or more objects

tables
.databaseName

(optional) 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

tables
.ownerName

(optional) specifies the unique name of a schema in a database.

""

string

1 to 64 bytes

tables
.tableName

specifies the name of a table.

Required - No default value

string

1 to 64 bytes

transformSteps

(optional) specifies an array of transform objects.

[]

array of objects

0 or more objects



The "tables" property contains an array of objects. Each object identifies a table. It defaults to a single default object. Each object in the "tables" array contains three properties:

  • databaseName

  • ownerName

  • tableName

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

The "transformSteps" property is an array of transform step objects. 

Different actions interpret "transformSteps": [] differently.

  • In the "alterIntegrationTable" action, "transformSteps" is optional. Setting it to [] removes transform steps from the integration table.

  • In the "createIntegrationTable" action, "transformSteps" is optional. Setting it to [] is the same as setting it to null or omitting it.

  • In the "testIntegrationTableTransformSteps" actions, "transformSteps" is required; thus, omitting it or setting it to [] or null is an error.

Each transform step object contains the required "transformStepMethod" property. It also supports the following optional properties:

  • "transformStepName"

  • "transformStepService"

Each transform step method also supports unique properties that are defined below.

"transformStepMethod": "javascript"

  • Required properties

    • "codeName"

  • Optional properties

    • "ownerName"

    • "databaseName"

"transformStepMethod": "tableFieldsToJson"

  • Required properties

    • "mapOfPropertiesToFields"

"transformStepMethod": "jsonToTableFields"

  • Required properties

    • "mapOfPropertiesToFields"

"transformStepMethod": "jsonToDifferentTableFields"

  • Required properties

    • "mapOfPropertiesToFields"

    • "targetTableName"

  • Optional properties

    • "targetOwnerName"

    • "targetDatabaseName"

Table 2. describeIntegrationTables "result" property summaries

Property

Description

Type

Limits (inclusive)

data

is an array of objects or arrays. Each item in the array describes a record. The array is empty if no results are available.

array

The action determines its contents.

data
.databaseName

specifies the name of a database.

string

1 to 64 bytes

data
.fields

contains objects that specify the settings of a field in a table.

array

"autoValue"
"name"
"type"
"length"
"primaryKey"
"scale"
"defaultValue"
"nullable"
data
.ownerName

specifies the name of the account that owns the integration table.

string

1 to 64 bytes

data
.retentionPeriod

specifies the number of retention units, which controls how long data is retained - see "retentionUnit".

integer

1 to 100

data
.retentionPolicy

controls how messages are persisted.

string

"autoPurge"
"neverPurge"
data
.retentionUnit

purges expired messages each time this unit cycles - see "retentionPeriod".

string

"minute"
"hour"
"day"
"week"
"month"
"year"
"forever"
data
.tableName

specifies the name of a table.

string

1 to 64 bytes

transformPercentComplete

provides an estimate of the transformation progress.

integer

0 to 99

transformStatus

describes the state of the transform.

string

the status of the transform



The "data" property is an array of objects or arrays that contain information about the database. The "dataFormat" property specifies whether the content is arrays or objects. The initiating action defines the data contents. In results messages, when no results are available, it is empty. For path formats, see "path".

Examples

arrays
"data":
[
  ["test1", ".\\test1.dbs\\SQL_SYS", 1003]
]
objects
"data":
[
  {
    "databaseName": "test7",
    "path": ".\\test7.dbs\\SQL_SYS",
    "uid": 1015
  }
]

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 "fields" property is an array of objects. It is required when creating a table. Each object in the array defines a field by specifying its properties.

Example

"fields": [
  {
    "autoValue": "none",
    "name": "name",
    "type": "varchar",
    "length": 50,
    "scale": null,
    "defaultValue": null,
    "nullable": false
  }
]

The "ownerName" property is an optional string from 1 to 64 bytes that specifies the account that owns an object, such as a table or code package. If it is set to null or is omitted, it defaults to the account that created the JSON Action session, see "createSession" and the "defaultOwnerName" property. 

You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package. 

This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code.

It is an error to set "ownerName" to the empty string "".

If no default owner is specified during "createSession", the server sets the "defaultOwnerName" to the "defaultOwnerName" value specified in the services.json file.

The "retentionPolicy" property controls how messages are persisted. This property is optional.

If not specified, the default found in the services.json file is used. Initially, it is "autoPurge".

retentionPolicy values:
  • "autoPurge"

    This is the default. It is automatically applied when a new topic is created. It is preferred because it allows FairCom's servers to automatically remove messages that are older than the retention time. This helps ensure message data does not consume all storage space. It also minimizes storage costs and speeds up data access. The server partitions a table into multiple files so it can efficiently delete expired files.

  • "neverPurge"

    This stores messages on disk and never removes them. This is useful when you need the entire history of the message stream. If message velocity is high, this can consume all storage space and cause an outage. The server creates a non-partitioned table, which is slightly faster than a partitioned table because it stores all records in one file.

The "retentionPeriod" property specifies how many units of data to retain. It must be an integer value from 1 to 100. It refers to the unit of time specified by the "retentionUnit" property — for example, if "retentionPeriod" is 14 and "retentionUnit" is "day", then message data is retained for 14 days. This property is optional.

  • Periodically, the system increments the age of each table partition.

    • "Minute" units are incremented at the zero second of each minute, whether the table partition was created 1 second before or 59 seconds before.

    • "Day" units are incremented at midnight GMT, not midnight of the local UTC time zone. A table partition becomes one day old at midnight GMT, whether it was created one second before or 23 hours and 59 seconds before.

    • "Week" units are incremented at midnight GMT on the last day of each week, even if the table partition was created one second before. The last day of the week is Saturday GMT.

    • "Month" units are incremented at midnight GMT on the last day of each month.

    • "Year" units are incremented at midnight GMT on Dec 31.

  • "retentionPeriod" implicitly calculates an upper bound on how many partitions are able to accumulate on your hard drive. However, partitions are not deleted just because this calculated number of partitions is reached. The system also does not restrict the deletion of all partitions.

  • If the FairCom database is shut down for a month, when the database is started up again, all partitions that are retained for less than one month are immediately deleted.

  • If someone purposely or accidentally sets the date to a future date, all partitions immediately become older, and auto-deletion ensues accordingly.

When partitions are auto-purged, some data are maintained "forever" in a global index. Auto-purge does not prevent these files from growing without bounds and filling up your hard drive.

If not specified, the default found in the services.json file is used. Initially, it is 4 (weeks).

Automatically purging data is important to ensure that retained data does not consume all storage and shut down the computer. The default value of 4 weeks allows FairCom's servers to store 1 TB of messages when 200 topics send one 2K message per second.

Note

  • If the value is not an integer from 1 to 100, FairCom's servers set it to the default value.

  • Smaller numbers improve SQL performance.

  • Each time the "retentionPeriod" cycles, FairCom's servers automatically and efficiently delete expired data.

  • The "retentionUnit" and "retentionPeriod" properties are used only when the "retentionPolicy" is set to "autoPurge".

  • FairCom's servers only use the "retentionPeriod" property when the "retentionPolicy" is "autoPurge".

  • The "retentionPeriod" can be changed to retain fewer or more messages. Changing it does not necessarily destroy existing data, but data may expire more quickly or be retained longer.

  • The "retentionPeriod" and "retentionUnit" properties control data granularity as well as the retention time.  In other words, "retentionPeriod" defines how many sets of data are stored, and "retentionUnit" defines how often data is purged.

    For example, if "rententionPeriod" is set to 14 , the server stores 14 sets of data. At the beginning of the 15th cycle, the server automatically purges the oldest set of data. If "retentionUnit" is set to day, then data will be purged daily. If set to "week", then data will be purged weekly.

  • The current calendar date affects purging.

    FairCom's servers automatically purge all retained data that has expired. This is noticeable when FairCom's servers come online after having been offline for a long time. When a server comes back online, it automatically purges all expired data.

    For example, if a FairCom server is offline for four weeks when it comes online, it will completely purge all retained data that has a retention time of less than 4 weeks.

Each time this unit cycles, FairCom purges expired messages. For example, if you want a week's worth of messages to be purged once a week, set "retentionUnit" to "week" . This property is optional.

If not specified, the default found in the services.json file is used. Initially, it is "week"

  • This property is used in concert with "retentionPeriod" to determine retention time.

  • "retentionUnit" values:

    • "minute"

    • "hour"

    • "day"

    • "week"

    • "month"

    • "year"

    • "forever"

Note

  • For best performance, set the "retentionUnit" to a value that keeps "retentionPeriod" between 5 and 30

  • When you set "retentionUnit" property to "forever" the server will not purge messages. This setting is the same as setting "retentionPolicy" to "neverPurge".

  • The "retentionUnit" and "retentionPeriod" properties are used only when the "retentionPolicy" is set to "autoPurge".

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

The "transformPercentComplete" property is an integer between 0 and 99 that is an estimate of the transformation progress when either the "rerunIntegrationTableTransformSteps" or "testIntegrationTableTransformSteps" action is transforming existing records in the integration table.

  • It is 0 when the action has finished, has not started, or is not transforming existing records.

  • It is between 1 and 99 while existing records are being transformed.

The "transformStatus" property is a string that describes the state of the transform process. Example values include "running" and "done".