The following API calls are available for the Azure Injector Module and can be executed within any of the available Ignition scopes.


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. Follow the instructions here to recover the configuration.

APIs

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)