Basic Operations

The following basic operations are available for the Azure Injector Module and can be executed within any of the available Ignition scopes using the format system.cirruslink.azure.operation

where:



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

For example, attempting to delete a Sets configuring that is being referenced by a Servers configuration will result in no action being performed.



AWS Injector 'type' keys

Azure Injector 'general' keys

enabledboolean

Whether or not the configuration resource is enabled

Azure Injector 'event-hub' keys

enabledboolean

Whether or not the configuration resource is enabled

namestring

The unique name for the configuration resource

serverSetstringThe Set this Event Hub connection is associated with
certAuthEnabledbooleanEnable certificate based authentication instead of using a connection string
connectionStringstringThe Azure Connection String used for establishing a connection with the Event Hub
tenantIdstringThe Azure Tenant ID
azureServicePrincipalClientIdstringThe Service Principal Client ID associated with the client certificate
eventHubNamespacestringThe Event Hub Namespace associated with the client certificate
eventHubNamestringThe Event Hub Namespace associated with the client certificate
clientCertFilestringClient certificate file currently in use
clientPrivateKeyFilestringClient private key file currently in use
c;lientKeyPasswordstringThe password associated with the certificate's private key (optional)
historyEnabledbooleanEnable Store and Forward capabilities for this stream
historyStoreTypestringThe Type of this Store & Forward mechanism
partionPeriodstringThe partitioning scheme to use for the Disk-backed history store (e.g. HOUR, MINUTE, DAY, etc)
historyMaxSizeintegerMaximum number of megabytes history can use before dropping the data
trimmerTaskPeriodMultiplierintegerA integer multiplier which is applied to the 'storageMonitorPeriod' which results in the period in which to trim potential excess history
historyMaxAgeintegerMaximum number of minutes to store history before dropping the data
queryTimeoutintegerThe H2 DB query timeout in seconds for the disk-backed history store
flushPeriodlongUpon reestablishing communication, the period to wait in milliseconds between sending when flushing messages
maxSizeintegerMaximum message size before dividing into multiple messages
contentEncodingstringThe content encoding of the data to push to Event Hub
azureDateTimeFormatstringThe date/time format to use when pushing data to Azure
h2dbDirectorystringDirectory to store the H2 Database in. Applicable for Disk-backed history store only
h2dbPortintegerTCP Port to connect to H2 Database. Applicable for Disk-backed history store only
dbMaxMessageSizeintegerThe Max Message size allowed in the Store and Forward DB. This only applies to Disk-Backed history stores
republishBirthsbooleanWhether or not to republish BIRTH messages on reestablishing connection to the endpoint

Azure Injector 'event-hub-cert-files' keys

enabledboolean

Whether or not the configuration resource is enabled

namestring

The unique name for the configuration resource

fileNamestringThe name of this certificate file or private key
descriptionstringThe description of this certificate file or private key
fileContentsstringThe contents of this certificate file or private key

Azure Injector 'iot-central' keys

enabledboolean

Whether or not the configuration resource is enabled

namestring

The unique name for the configuration resource

scopeIdstringThe Azure IoT Central Scope ID
enrollmentGroupSymmetricKeystringThe Azure Enrollment Group Symmetric Key
globalEndPointstringThe global endpoint of the IoT Central connection
provisionedDeviceIdstringThe provisioned Device ID associated with this IoT Central connection
modelIdstringThe Model ID associated with this IoT Central connection
serverSetstringThe Set this IoT Central connection is associated with
historyEnabledbooleanEnable Store and Forward capabilities for this stream
historyStoreTypestringThe Type of this Store & Forward mechanism
partionPeriodstringThe partitioning scheme to use for the Disk-backed history store (e.g. HOUR, MINUTE, DAY, etc)
historyMaxSizeintegerMaximum number of megabytes history can use before dropping the data
trimmerTaskPeriodMultiplierintegerA integer multiplier which is applied to the 'storageMonitorPeriod' which results in the period in which to trim potential excess history
historyMaxAgeintegerMaximum number of minutes to store history before dropping the data
queryTimeoutintegerThe H2 DB query timeout in seconds for the disk-backed history store
flushPeriodlongUpon reestablishing communication, the period to wait in milliseconds between sending when flushing messages
maxSizeintegerMaximum message size before dividing into multiple messages
expirationlongThe number of seconds before the session token expires
azureDateTimeFormatstringThe date/time format to use when pushing data to Azure
h2dbDirectorystringDirectory to store the H2 Database in. Applicable for Disk-backed history store only
h2dbPortintegerTCP Port to connect to H2 Database. Applicable for Disk-backed history store only
dbMaxMessageSizeintegerThe Max Message size allowed in the Store and Forward DB. This only applies to Disk-Backed history stores
republishBirthsbooleanWhether or not to republish BIRTH messages on reestablishing connection to the endpoint

Azure Injector 'iot-edge-hub' keys

enabledboolean

Whether or not the configuration resource is enabled

namestring

The unique name for the configuration resource

protocolstringThe IoT Edge Hub client protocol
serverSetstringThe Set this IoT Central connection is associated with
automaticbooleanIf true, Azure Edge environment variables will be used as the connection parameters rather than those defined in the Connectivity and Authentication sections of this configuration
mqttServerUrlstringThe MQTT Server URL for the Azure IoT Edge
certAuthEnabledbooleanEnable certificate based authentication instead of using a connection string
connectionStringstringThe Connection String used for establishing a connection with the IoT Edge when using 'Connection String Authentication'. This is either the Connection String associated with the Child Device or with the Azure Edge Module
caCertFilestringCA Certificate file currently in use on the IoT Edge instance. It is used for both Certificate and Connection String based authentication. This is the CA Device Certificate that was uploaded to the Azure Edge instance
clientCertFilestringClient certificate file currently in use
clientPrivateKeyFilestringClient private key file currently in use
clientKeyPasswordstringThe password associated with the certificate's private key (optional)
hostnameVerificationbooleanEnable TLS Hostname Verification. This should be true on production systems
mqttHostnamestringThe hostname of the Azure IoT Hub endpoint
deviceIdstringThe Device ID as provisioned in the Azure IoT Edge configuration
moduleIdOptionstringThe method to use to configure the Module ID. Options are NONE, ENVIRONMENT_VARIABLE, IOTEDGE_MODULEID, or IGNITION_CONFIG
historyEnabledbooleanEnable Store and Forward capabilities for this stream
historyStoreTypestringThe Type of this Store & Forward mechanism
partionPeriodstringThe partitioning scheme to use for the Disk-backed history store (e.g. HOUR, MINUTE, DAY, etc)
historyMaxSizeintegerMaximum number of megabytes history can use before dropping the data
trimmerTaskPeriodMultiplierintegerA integer multiplier which is applied to the 'storageMonitorPeriod' which results in the period in which to trim potential excess history
historyMaxAgeintegerMaximum number of minutes to store history before dropping the data
queryTimeoutintegerThe H2 DB query timeout in seconds for the disk-backed history store
flushPeriodlongUpon reestablishing communication, the period to wait in milliseconds between sending when flushing messages
maxSizeintegerMaximum message size before dividing into multiple messages
expirationlongThe number of seconds before the session token expires
contentTypestringThe content type to include in the topic to Azure IoT Hub
contentEncodingstringThe content encoding to include in the topic to Azure IoT Hub
azureDateTimeFormatstringThe date/time format to use when pushing data to Azure
customTopicExtensionstringThe Custom Topic Extension to append to the topic string for things like Application Properties
autoGeneratedbooleanWhether or not the connection details were auto-generated
h2dbDirectorystringDirectory to store the H2 Database in. Applicable for Disk-backed history store only
h2dbPortintegerTCP Port to connect to H2 Database. Applicable for Disk-backed history store only
dbMaxMessageSizeintegerThe Max Message size allowed in the Store and Forward DB. This only applies to Disk-Backed history stores
republishBirthsbooleanWhether or not to republish BIRTH messages on reestablishing connection to the endpoint

Sample Script


Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need.


# Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need
# Update Certificates
# Get Id for current certificate
savedCerts = system.cirruslink.azure.readConfig("Cert Files")
for config in savedCerts:
  if config["Name"] == "My current cert name":
    certId = config["Id"]

# Read New Cert File
deviceCaCertFilePath = "/path/to/your/certs/iot-edge-device-ca-CA.cert.pem"
deviceCaCert = open(deviceCaCertFilePath, 'r').read()

# Update existing cert config using MergeOverwrite
certProps = {}
certProps["FileContents"] = deviceCaCert
system.cirruslink.azure.updateConfig(“Cert Files”, certId, “MergeOverwrite”, certProps)