Coverage for wireless/api/serializers_/wirelesslinks.py: 100%
21 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
1from dcim.api.serializers_.device_components import InterfaceSerializer
2from dcim.choices import LinkStatusChoices
3from netbox.api.fields import ChoiceField
4from netbox.api.serializers import PrimaryModelSerializer
5from netbox.choices import *
6from tenancy.api.serializers_.tenants import TenantSerializer
7from wireless.choices import *
8from wireless.models import WirelessLink
10__all__ = (
11 'WirelessLinkSerializer',
12)
15class WirelessLinkSerializer(PrimaryModelSerializer):
16 status = ChoiceField(choices=LinkStatusChoices, required=False)
17 interface_a = InterfaceSerializer(nested=True)
18 interface_b = InterfaceSerializer(nested=True)
19 tenant = TenantSerializer(nested=True, required=False, allow_null=True)
20 auth_type = ChoiceField(choices=WirelessAuthTypeChoices, required=False, allow_blank=True)
21 auth_cipher = ChoiceField(choices=WirelessAuthCipherChoices, required=False, allow_blank=True)
22 distance_unit = ChoiceField(choices=DistanceUnitChoices, allow_blank=True, required=False, allow_null=True)
24 class Meta:
25 model = WirelessLink
26 fields = [
27 'id', 'url', 'display_url', 'display', 'interface_a', 'interface_b', 'ssid', 'status', 'tenant',
28 'auth_type', 'auth_cipher', 'auth_psk', 'distance', 'distance_unit', 'description', 'owner', 'comments',
29 'tags', 'custom_fields', 'created', 'last_updated',
30 ]
31 brief_fields = ('id', 'url', 'display', 'ssid', 'description')