Crimson Robe
Crimson Robe

Reputation: 13

Instance of 'Dcim' has no 'get_device_by_name' member

I got following error when I want to call get_device_by_name from python-netbox library:

Instance of 'Dcim' has no 'get_device_by_name' member

With reference to documentation this method shoul exist https://python-netbox.readthedocs.io/en/latest/examples.html#examples

Sample of my code:

from netbox import NetBox

class NboxM:
    def __init__(self):
        self.nbox = NetBox(
            host='host', 
            port='port', 
            use_ssl=False, 
            auth_token='token'
        )
        self.nbox.dcim.get_device_by_name('name')

My lib version: python-netbox 0.0.14

Upvotes: 1

Views: 96

Answers (1)

Artur
Artur

Reputation: 688

It seems they removed it. Instead of get_device_by_name('name') you should use get_devices(name='name'). See the README:

https://github.com/jagter/python-netbox

By the way I created the issue on the repo:

https://github.com/jagter/python-netbox/issues/22

Upvotes: 0

Related Questions