diff --git a/netbox_agent/network.py b/netbox_agent/network.py index 673dfc1..ff1a8bf 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -556,10 +556,12 @@ class ServerNetwork(Network): switch_ip, )) cable = nb.dcim.cables.create( - termination_a_id=nb_server_interface.id, - termination_a_type="dcim.interface", - termination_b_id=nb_switch_interface.id, - termination_b_type="dcim.interface", + a_terminations=[ + {"object_type": "dcim.interface", "object_id": nb_server_interface.id}, + ], + b_terminations=[ + {"object_type": "dcim.interface", "object_id": nb_switch_interface.id}, + ], ) nb_server_interface.cable = cable logging.info( @@ -579,7 +581,7 @@ class ServerNetwork(Network): switch_ip, switch_interface, nb_server_interface ) else: - nb_sw_int = nb_server_interface.cable.termination_b + nb_sw_int = nb_server_interface.cable.b_terminations[0] nb_sw = nb_sw_int.device nb_mgmt_int = nb.dcim.interfaces.get( device_id=nb_sw.id,