From 6f874ff13369cadbb8924d67514d8eeef42bae6a Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Mon, 3 Mar 2025 12:29:47 -0600 Subject: [PATCH] Updates vpn.L2VPN docs Also rearranges L2VPNStatusChoices so that the default value (active) is first. --- docs/models/vpn/l2vpn.md | 13 +++++++++++++ netbox/vpn/choices.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/models/vpn/l2vpn.md b/docs/models/vpn/l2vpn.md index 1167c1c17..983095ef8 100644 --- a/docs/models/vpn/l2vpn.md +++ b/docs/models/vpn/l2vpn.md @@ -33,6 +33,19 @@ The technology employed in forming and operating the L2VPN. Choices include: !!! note Designating the type as VPWS, EPL, EP-LAN, EP-TREE will limit the L2VPN instance to two terminations. +### Status + +The operational status of the L2VPN. By default, the following statuses are available: + +* Active (default) +* Planned +* Faulty + +!!! tip "Custom L2VPN statuses" + Additional L2VPN statuses may be defined by setting `L2VPN.status` under the [`FIELD_CHOICES`](../../configuration/data-validation.md#field_choices) configuration parameter. + +!!! info "This field was introduced in NetBox v4.3." + ### Identifier An optional numeric identifier. This can be used to track a pseudowire ID, for example. diff --git a/netbox/vpn/choices.py b/netbox/vpn/choices.py index 90ec1af07..b0a420f98 100644 --- a/netbox/vpn/choices.py +++ b/netbox/vpn/choices.py @@ -272,12 +272,12 @@ class L2VPNTypeChoices(ChoiceSet): class L2VPNStatusChoices(ChoiceSet): key = 'L2VPN.status' - STATUS_PLANNED = 'planned' STATUS_ACTIVE = 'active' + STATUS_PLANNED = 'planned' STATUS_DECOMMISSIONED = 'decommissioned' CHOICES = [ - (STATUS_PLANNED, _('Planned'), 'cyan'), (STATUS_ACTIVE, _('Active'), 'green'), + (STATUS_PLANNED, _('Planned'), 'cyan'), (STATUS_DECOMMISSIONED, _('Decommissioned'), 'red'), ]