Example #1
0
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',
        ]
Example #2
0
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',
        ]
Example #3
0
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',
        ]