NetBox Create VLAN Group Task¤
task API name:
create_vlan_group
The create_vlan_group task creates or updates one VLAN group scoped to a NetBox site. The design engine uses it before allocating VLANs for a site.
Inputs¤
| Parameter | Required | Default | Description |
|---|---|---|---|
name |
Yes | — | VLAN group name |
site |
Yes | — | Existing site used as the group scope |
vid_ranges |
Yes | — | Inclusive VLAN ID ranges, such as [[10, 99]] |
instance |
No | Worker default | NetBox instance to target |
dry_run |
No | False |
Return the proposed action without writing |
branch |
No | None |
NetBox Branching plugin branch name |
Example¤
result = client.run_job(
"netbox",
"create_vlan_group",
workers="any",
kwargs={
"name": "SITE-001 VLANS",
"site": "SITE-001",
"vid_ranges": [[10, 99]],
},
)
In a design:
{% set vlan_group = netbox.create_vlan_group(name=context.site ~ " VLANS", site=context.site, vid_ranges=[[10, 99]]) %}
The site must exist before the task runs.
Python API Reference¤
Create or update one site-scoped VLAN group.
Source code in norfab\workers\netbox_worker\vlan_tasks.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |