Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Basic Operations

The following API calls basic operations are available for the MQTT Recorder Module and can be executed within any of the available Ignition  scopes.

APIs

...

scopes using the format system.cirruslink.recorder.operation

  • createConfig(type, props) → void
  • Parameters
    • Type (str)
      • The type of configuration to create with valid options:

        • "General"
        • "Tables"
    • Map props
      • Dictionary of properties making up the configuration with the following keys and datatypes:
        • General
          • Id (Long)(cannot be null)

          • Enabled (bool)
          • Datasource (str)
          • PartitionPeriod (str)
        • Tables
          • Id (long)(cannot be null)
          • TableName (str)

          • Enabled (bool)

          • RecordType (str)

          • GroupId (str)

          • EdgeNodeId (str)

          • DeviceId (str)

          • FilteredProperties (str)

  • name, config, enabled, description)
    • enabled (boolean) and description (string) are optional calls
    • returns a dictionary that represents the config.json of the specified resource
  • deleteConfig(type, name)
    • returns a boolean
  • getConfigNames(type, enabled)
    • enabled is an optional call
    • returns a list strings
  • isConfigEnabled(type, name)
    • returns a boolean
  • readConfig(type, name)
    • returns a dictionary that represents the config.json of the specified resource
  • setConfigEnabled(type, name, enabled)
    • returns a boolean 
  • updateConfig(type, name, collisionPolicy, config)
    • returns a dictionary that represents the config.json of the specified resource

where:

  • type
    • string denoting the type of configuration to operate on
  • name
    • string denoting the unique name for the configuration resource to operate on
  • config
    • dictionary of properties making up the configuration resource to operate on
      • general
      • table
  • enabled
    • boolean
  • collisionPolicy
    • string with options
    Return ValueA map representing the newly created configuration after it has been written to the database. (added 4.0.16)
    AnchorreadConfigreadConfigsystem.cirruslink.recorder.readConfig(type) → List
    • Parameters
      • Type(str)
        • The type of configuration to read with valid options:

          • "General"
          • "Tables"
    • Return Value
      • A List of the Dictionaries of properties making up the configurations with the following keys and datatypes:
        • General
          • Id (Long)

          • Enabled (bool)
          • Datasource (str)
          • PartitionPeriod (str)
        • Tables
          • Id (long)
          • TableName (str)
          • Enabled (bool)
          • RecordType (str)
          • GroupId (str)
          • EdgeNodeId (str)
          • DeviceId (str)
          • FilteredProperties (str)
    AnchorupdateConfigupdateConfigsystem.cirruslink.recorder.updateConfig(type, id, collisionPolicy, props) → void
    • Parameters
    • Type(str)
      • The type of configuration to update with valid options:
        • "General"
        • "Tables"
    • Id (long)
      • The ID of the record to update
    • collisionPolicy(str) "MergeOverwrite" or "Overwrite"
      • "MergeOverwrite" will replace the existing properties in the record ID with resource name with only those included in the call
      • "Overwrite" will replace all properties in the record ID resource name with those in the call
      • Map props
        • Dictionary of properties making up the configuration with the following keys and datatypes:
          • General
            • Id (Long)

            • Enabled (bool)
            • Datasource (str)
            • PartitionPeriod (str)
          • Tables
            • Id (long)
            • TableName (str)
            • Enabled (bool)
            • RecordType (str)
            • GroupId (str)
            • EdgeNodeId (str)
            • DeviceId (str)
            • FilteredProperties (str)
    • Return value
      • A map representing the updated configuration after it has been written to the database. (added 4.0.16)
    AnchordeleteConfigdeleteConfigsystem.cirruslink.recorder.deleteConfig(type, id) → void
  • Parameters
    • Type(str)
      • The type of configuration to delete with valid options:
        • "General"
        • "Tables"
    • Id (long)
      • The ID of the record to delete
  • Return valueTrue if the record was successfully deleted otherwise False is returned. (added 4.0.16)


Warning

Configuration changes made through scripting do not have the same validation as when made through the UI. 

For example, deleting a Sets configuring that is being referenced by a Servers configuration will result in the UI showing an Internal Error

Anchor
type
type
Recorder 'type' keys

Anchor
general
general
Recorder 'general' keys

enabledboolean

Whether or not the configuration resource is enabled

namestring

The unique name for the configuration resource

enableDistributorboolean

Whether to enable MQTT Recorder

dataSourcestring

The Datasource to use for storage

tablePartitionPeriodstring

The period by which tables will be partitioned

Anchor
table
table
Recorder 'table' keys

enabledboolean

Whether or not the configuration resource is enabled

namestringThe unique name for the configuration resource
tableNamestringThe table name
recordTypestringA table name that supports token substitution for the following: ${type}, ${group}, ${edgenode
groupIdstringA Group ID used for matching (optional)
edgeNodeIdstringAn Edge Node ID used for matching (optional)
deviceIdstringA Device ID used for matching (optional)
fieldFilterstringA semicolon delimited list of field filters