Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Add support for VLAN group available vlans API call #22

Open
pobradovic08 opened this issue Jan 5, 2024 · 0 comments · May be fixed by #23
Open

bug: Add support for VLAN group available vlans API call #22

pobradovic08 opened this issue Jan 5, 2024 · 0 comments · May be fixed by #23

Comments

@pobradovic08
Copy link
Contributor

NetBox Python version

v0.1.6

NetBox version

v3.6.6

Python version

3.11

Steps to Reproduce

Trying to call:

self.api.ipam.vlan_group.available_vlans.list(id=group_id, limit=1)

or

self.api.ipam.vlan_groups.available_vlans.list(id=group_id, limit=1)

Fails with AttributeError: 'ipam' object has no attribute 'vlan_group'. or AttributeError: '_vlan_groups' object has no attribute 'available_vlans'.

Expected Behavior

Like for ipam.asn_range.available_asns (which is a singular of asn_ranges) and ipam.ip_range.available_ips (singular of ip_ranges), I would expect to have ipam.vlan_group.available_vlans.

Observed Behavior

Calls fail with above mentioned errors (AttributeError: 'ipam' object has no attribute 'vlan_group'. or AttributeError: '_vlan_groups' object has no attribute 'available_vlans'). In /api/ipam.py there are definitions for ASN and IP ranges:

class ipam:
    def __init__(self, client):
        ...
        self.asn_ranges = self._asn_ranges(client)
        self.asn_range = asn_range(client)
        ...
class ipam:
    def __init__(self, client):
        ...
        self.ip_ranges = self._ip_ranges(client)
        self.ip_range = ip_range(client)
        ...

but there are no self.vlan_group defined for vlan_groups although there is an import:

from netbox_python.api.vlan_group import vlan_group

And vlan_group.py file already exists.

@pobradovic08 pobradovic08 linked a pull request Jan 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant