mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
Expose full interface address list and link state in cloud node API
Each host interface surfaced by the cloud node now reports: - ip_addresses: every IPv4 and IPv6 address (previously only a single IPv4 was collected internally and then dropped before the response) - status / speed / mtu / flags: operational state and link attributes sourced from psutil.net_if_stats(), with flags normalized to a list The legacy ip_address / netmask / mac_address fields are preserved so existing callers (compute link detection, GNS3 VM, VMware, has_netmask) keep working. The new fields travel through the existing interfaces payload that the controller forwards verbatim, so no controller-side change is required and the PUT / ports_mapping flow is unaffected.
This commit is contained in:
6 files changed
+196
-11
No files matched your search
@@ -83,7 +83,16 @@ class Cloud(BaseNode):
|
||||
network_interfaces = gns3server.utils.interfaces.interfaces()
|
||||
for interface in network_interfaces:
|
||||
host_interfaces.append(
|
||||
{"name": interface["name"], "type": interface["type"], "special": interface["special"]}
|
||||
{
|
||||
"name": interface["name"],
|
||||
"type": interface["type"],
|
||||
"special": interface["special"],
|
||||
"ip_addresses": interface.get("ip_addresses", []),
|
||||
"status": interface.get("status", "down"),
|
||||
"speed": interface.get("speed", 0),
|
||||
"mtu": interface.get("mtu", 0),
|
||||
"flags": interface.get("flags", []),
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user