Air gap Features
7 min
the airgap features module builds deployment templates programmatically so you can configure a litmus edge instance without it ever needing to reach the internet useful for industrial / ot networks, customer sites with strict outbound rules, and reproducible bring up of identical edges imports from litmussdk airgap features template creation import airgap template the main builder is the airgaptemplate class build a template from litmussdk airgap features template creation import airgap template t = airgap template airgaptemplate() \# add devices and their tags device = devices list device by id(device id) t add entire devicehub device(device) \# add a digital twin model t add digital twin model(model id=" ") \# add a flow t add flow(flow id=" ") \# add an analytics group t add analytics group(group name="default") \# add a marketplace registry / image t add marketplace registry(registry id=" ") \# add system settings (auth providers, certs, ntp, dns, etc ) t add system settings() \# generate the template payload template = t build() the result is a json serializable dict that mirrors what system templates apply template accepts you can save it to disk, ship it on a usb stick, then apply it on the target edge import json \# on the build machine with open("plant floor json", "w") as f json dump(template, f, indent=2) \# on the air gapped edge (with the sdk pointed at it) from litmussdk system import templates with open("plant floor json") as f templates apply template(json load(f)) composing from a live edge the add entire devicehub device family of methods works against a connected source edge the typical flow is run the builder against a "golden" edge that has the configuration you want save the generated template json apply that json on n target edges the source connection is the standard sdk default connection or an explicit leconnection you pass to each add call including flows with their file content for flows manager, the template can include the flow file contents (so the target edge has both the flow definition and its on disk artifacts) flow id = 1 flow content = flows download flow file(flow id) # bytes t add flow(flow id=flow id, flow file=flow content) download flow file returns proper bytes as of sdk 2 6 0; prior versions silently corrupted the content via utf 8 decode see release notes including marketplace images marketplace images (docker registry containers) can be embedded by reference the target edge must still be able to pull from the registry, or the image must be pre loaded onto the target t add marketplace image(image id=" ", registry id=" ") license copyright (c) litmus automation inc