class CircuitTerminationSerializer(serializers.ModelSerializer): circuit = NestedCircuitSerializer() site = NestedSiteSerializer() interface = InterfaceSerializer() class Meta: model = CircuitTermination fields = [ 'id', 'circuit', 'term_side', 'site', 'interface', 'port_speed', 'upstream_speed', 'xconnect_id', 'pp_info', ]
class IPAddressSerializer(CustomFieldModelSerializer): vrf = NestedVRFSerializer() tenant = NestedTenantSerializer() status = ChoiceFieldSerializer(choices=IPADDRESS_STATUS_CHOICES) interface = InterfaceSerializer() class Meta: model = IPAddress fields = [ 'id', 'family', 'address', 'vrf', 'tenant', 'status', 'interface', 'description', 'nat_inside', 'nat_outside', 'custom_fields', ]
class CircuitTerminationSerializer(ValidatedModelSerializer): circuit = NestedCircuitSerializer() site = NestedSiteSerializer() interface = InterfaceSerializer(required=False, allow_null=True) class Meta: model = CircuitTermination fields = [ 'id', 'circuit', 'term_side', 'site', 'interface', 'port_speed', 'upstream_speed', 'xconnect_id', 'pp_info', ]