Hello,
Is it possible to add a lag on an existing interface via pynetbox ?
I did some tests but I can not do it...
Here is the information I retrieve / use:
Device:
command:
sesrv=nb.dcim.devices.get(name=srsrv)
result:
"v3bj33-cas01"
Dictionnary Device
I create a dictionnary to store all information about my device:
Command:
result:
{'name': 'v3bj33-cas01', 'id': 648}
Interface (to add LAG):
command:
get_sint = nb.dcim.interfaces.get(
device_id=
sesrv.id,
name=srint,
)
result:
"ETH1/14"
LACP (lag) information:
Command:
get_po = nb.dcim.interfaces.get(
device_id=
sesrv.id,
name=po,
)
result:
"Po700"
Dictionnary lag:
I create a dictionnary for lag informations:
test={
'id':
get_po.id,
'device':dict_sesrv,
}
For me, I have all the information required to add my lag (already existing) on my interface
I admit I do not know if I should perform a create or update.
I tried to create but it is not working.
This is the second trial:
result:
{"non_field_errors":["The fields device, name must make a unique set."]}
So do you have an idea?
Thx