Usage Guideline + Authenticati...
Air gap Features
4min
a few features of edge device can be accessed without needing a connection to that device for example, creating a devicehub device is not possible in air gap scenarios, but creating a template file, ready to be uploaded to edge devices can be done locally without any connection needed for the edge device air gap templates to create json templates for litmus edge without actually connecting to it, you can use the following module from the sdks from litmussdk airgap features template creation import airgaptemplate my airgap template = airgaptemplate() this imports the module airgaptemplate from sdk, and then creates an empty my airgap template object, ready to be used and filled with whatever features that need to be included in the template here are some examples of the methods available in this object airgaptemplate \<method> description required parameters show template() displays the current configuration of the template to dict() converts the current configuration to a dictionary, excluding unchanged fields save to file() saves the current configuration to a json file file path path to where to store the output json file add auth provider() adds a new authentication provider name (str) name of the authentication provider auth provider type (str) type of authentication provider bind dn (str, optional) bind dn for ldap authentication bind dn password (str, optional) password for bind dn group attr group (str, optional) group attribute for groups group attr name (str, optional) name attribute for groups group attr user (str, optional) user attribute for groups group filter (str, optional) group filter string group search base dn (str, optional) base dn for group search group search scope (str, optional) scope of group search groups to roles (dict, optional) mapping of groups to roles host (str, optional) host address of authentication provider port (int, optional) port number for authentication provider tls (bool, optional) whether tls is enabled tls root ca (str, optional) root ca for tls user attr first name (str, optional) first name attribute user attr id (str, optional) user id attribute user attr last name (str, optional) last name attribute user attr username (str, optional) username attribute user filter (str, optional) user filter string user search base dn (str, optional) base dn for user search user search scope (str, optional) scope of user search change timezone() updates the system timezone timezone (str, optional) new timezone setting defaults to "utc" change country() updates the system country setting country (str, optional) new country code defaults to "us" change dns resolvers() updates the dns resolver list dns (list\[str], optional) list of dns resolvers defaults to an empty list change ntp servers() updates the ntp server list ntp servers (list\[str], optional) list of ntp servers defaults to an empty lis change docker binding ip() updates the docker binding ip binding ip (str, optional) new ip binding defaults to "10 30 50 1/24" change firewall rules() clears the docker binding ip firewall rules (list\[dict], optional) list of firewall rules defaults to an empty list add digital twins model() adds a new digital twin model name (str) name of the model dynamic attributes (list\[dict], optional) list of dynamic attributes static attributes (list\[dict], optional) list of static attributes transformation (list\[dict], optional) transformation rules description (str, optional) model description image (str, optional) image reference for the model model id (str, optional) unique identifier for the model is uns (bool, optional) uns flag defaults to false assets (str, optional) asset type defaults to "asset" hierarchy nodes (any, optional) hierarchical structure nodes connector name (str, optional) associated connector name add digital twins instance() add digital twins instance with the required parameter as input instance name (str) name of the digital twin instance model name (str, optional) name of the associated model model id (str, optional) id of the associated model instance id (str, optional) id of the instance generated if not provided interval (int, optional) data collection interval defaults to 1 data topic (str, optional) mqtt topic for data instance dynamic attributes (list\[dict], optional) dynamic attributes instance static attributes (list\[dict], optional) static attributes instance image (str, optional) image reference for instance is enabled (bool, optional) whether the instance is enabled defaults to true flatten (bool, optional) whether to flatten attributes defaults to false add opcua() configures the opc ua settings users (list | str, optional) list of opc ua users hierarchy (dict, optional) hierarchical structure for opc ua nodes modes (dict, optional) security modes for opc ua policies (dict, optional) security policies for opc ua enabled (bool, optional) whether opc ua is enabled certificates (list, optional) list of security certificates add devicehub device() adds a new device to devicehub device name (str) name of the device driver id (str) id of the driver associated with the device device settings (dict) configuration settings for the device alias topics (bool, optional) whether to use alias topics defaults to true debug (bool, optional) enables debug mode defaults to false worker params (dict, optional) worker parameters defaults to none dh params (dict, optional) devicehub specific parameters defaults to none device id (str, optional) unique identifier for the device defaults to a generated uuid add entire devicehub device() adds a fully defined device object to devicehub device (devices device) the device object to add (this uses the pydantic model devices device type, if it is already added) add tag to device() adds a tag to a specified device register name (str) name of the register tag name (str) name of the tag register settings (dict) configuration settings for the tag register value type (str) data type of the tag value register id (str, optional) unique id for the tag defaults to a generated uuid device name (str, optional) name of the device to associate with the tag description (str, optional) description of the tag defaults to an empty string reset auth() resets the authentication providers in the template file to the initial state remove auth provider() removes an authentication provider by name in the template file provider name (str) name of the authentication provider to remove remove dns resolvers() clears the dns resolver list in the template file remove ntp servers() clears the ntp server list in the template file remove docker binding ip() clears the docker binding ip in the template file remove firewall rules() clears the firewall rules in the template file remove digital twins model() removes a digital twin model and associated instances in the template file model name (str) name of the model to remove remove digital twins instance() removes a digital twin instance by name in the template file instance name (str) name of the instance to remove remove devicehub device() removes a device from devicehub by name from the template file device name (str, optional) name of the device to remove remove devicehub tag() removes a tag from a specified device from the template file device name (str, optional) name of the device containing the tag tag name (str, optional) name of the tag to remove reset devicehub() clean template file of any added devices and tags reset opcua() clean template file of any opc ua changes reset digital twins() clean template file of any digital twins models and instances reset dm() clean template file of any changes made to system config so in this case, to use any of the method, you would write something like this print(my airgap template show template()) \## or ## my airgap template save to file("downloads/le template json") \## or ## my airgap template add digital twins instance(instance name "instance1", model name = "digitaltwinmodel1", model id = "\<dt model id>", instance dynamic attributes = none, instance static attributes = none, ) coming soon air gap templates is still under development for the following compontents analytics marketplace/applications integration data store configuration of devicehub