File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 22========
33
44.. autoclass :: pynetbox.models.ipam.Prefixes
5- :members:
5+ :members:
6+
7+ .. autoclass :: pynetbox.models.ipam.VlanGroups
8+ :members:
Original file line number Diff line number Diff line change @@ -97,3 +97,34 @@ def available_prefixes(self):
9797class Aggregates (Record ):
9898 def __str__ (self ):
9999 return str (self .prefix )
100+
101+
102+ class Vlans (Record ):
103+ def __str__ (self ):
104+ return super ().__str__ (self ) or str (self .vid )
105+
106+
107+ class VlanGroups (Record ):
108+ @property
109+ def available_vlans (self ):
110+ """ Represents the ``available-vlans`` detail endpoint.
111+
112+ Returns a DetailEndpoint object that is the interface for
113+ viewing and creating VLANs inside a VLAN group.
114+
115+ Available since NetBox 3.2.0.
116+
117+ :returns: :py:class:`.DetailEndpoint`
118+
119+ :Examples:
120+
121+ >>> vlan_group = nb.ipam.vlan_groups.get(1)
122+ >>> vlan_group.available_vlans.list()
123+ [10, 11, 12]
124+
125+ To create a new VLAN:
126+
127+ >>> vlan_group.available_vlans.create({"name": "NewVLAN"})
128+ NewVLAN (10)
129+ """
130+ return DetailEndpoint (self , "available-vlans" , custom_return = Vlans )
You can’t perform that action at this time.
0 commit comments