eta_nexus.servers.loaders.opcua_server_loader module
- eta_nexus.servers.loaders.opcua_server_loader.load_opcua_servers_from_config(config_path: str) list[OpcuaServer][source]
Load and instantiate OPC UA servers from a configuration file.
- Supported config shapes (both are normalized internally):
- {
- “servers”: [
- {
“namespace”: “Factory”, “ip”: “127.0.0.1”, “port”: 4840, “ns_index”: 2, # optional, default 2 “nodes”: [
{“name”: “Temperature”, “path”: “Factory.Line1.T”, “datatype”: “float”}, …
]
}, …
]
}
- {
- “system”: [
- {
“name”: “CHP”, “servers”: {
“glt”: {“url”: “127.0.0.1:4840”, “protocol”: “opcua”, “usr”: “…”, “pwd”: “…”}
}, “nodes”: [
- {“name”: “power_elek”, “server”: “glt”,
“opc_id”: “ns=6;s=…”, “dtype”: “float”},
…
]
}
]
}
- Normalization rules:
Endpoint: prefer url/endpoint (with or without opc.tcp://); otherwise compose from ip + port.
If only url is provided, it is parsed into ip and port.
NodeId: prefer explicit opc_id; else derive from path using ns_index (default 2): ns={ns_index};s=.{{path}}.
DType aliases are mapped case-insensitively (e.g., double→float, boolean→bool, uint16→int).
- Returns:
List[OpcuaServer] with nodes created and attached.