Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

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

@pobradovic08

Description

@pobradovic08

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions