canonical / python-libmaas

Unofficial python client library for MAAS
https://maas.io
Other
63 stars 71 forks source link

NameError: name 'LinkMode' is not defined #273

Closed erichfeth closed 2 years ago

erichfeth commented 2 years ago

I'm trying to change the IP configuration of an interface using the documentation here: https://maas.github.io/python-libmaas/client/interfaces/index.html

and I'm getting an error that the LinkMode field is not defined.

interfacename = machinename.interfaces.get_by_name('eth0')
interfacename.links.create(LinkMode.STATIC, subnet='192.168.99.0/24', ip_address='192.168.99.100')

How do I assign a static ip address to this interface?