nodes: per-node netmiko_device_type (controller-only)

netmiko_device_type follows the CONTROLLER_ONLY_PROPERTIES pattern
(like console_auto_start): a node created from a template inherits the
template value, PUT /nodes can override it inside a topology, updates
never round-trip to the compute, and the value persists in the project
topology file.
This commit is contained in:
YueGuobin committed 2026-08-21 21:41:35 +08:00
1 parent 9260108f53
commit d64f47afa4
3 files changed
+48

No files matched your search

+11
View File
@@ -57,6 +57,7 @@ class Node:
"ports",
"category",
"console_auto_start",
"netmiko_device_type",
]
def __init__(self, project, compute, name, node_id=None, node_type=None, template_id=None, **kwargs):
@@ -112,6 +113,7 @@ class Node:
self._port_segment_size = 0
self._first_port_name = None
self._console_auto_start = False
self._netmiko_device_type = None
# This properties will be recomputed
ignore_properties = ("width", "height", "hover_symbol")
@@ -212,6 +214,14 @@ class Node:
def console_auto_start(self, val):
self._console_auto_start = val
@property
def netmiko_device_type(self):
return self._netmiko_device_type
@netmiko_device_type.setter
def netmiko_device_type(self, val):
self._netmiko_device_type = val
@property
def properties(self):
return self._properties
@@ -833,6 +843,7 @@ class Node:
"console": self._console,
"console_type": self._console_type,
"console_auto_start": self._console_auto_start,
"netmiko_device_type": self._netmiko_device_type,
"aux": self._aux,
"aux_type": self._aux_type,
"properties": self._properties,