mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 11:53:12 +00:00
Serialisation de la liste des vlans
This commit is contained in:
parent
aec2c645a2
commit
20126a3cd6
1 changed files with 13 additions and 1 deletions
|
@ -660,10 +660,19 @@ class ServiceRegenSerializer(NamespacedHMSerializer):
|
||||||
|
|
||||||
# Switches et ports
|
# Switches et ports
|
||||||
|
|
||||||
|
class VlanPortSerializer(NamespacedHMSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = machines.Vlan
|
||||||
|
fields = ('vlan_id', 'name')
|
||||||
|
|
||||||
|
|
||||||
class ProfilSerializer(NamespacedHMSerializer):
|
class ProfilSerializer(NamespacedHMSerializer):
|
||||||
|
vlan_untagged = VlanSerializer(read_only=True)
|
||||||
|
vlan_tagged = VlanPortSerializer(read_only=True, many=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = topologie.PortProfile
|
model = topologie.PortProfile
|
||||||
fields = ('name', 'profil_default', 'vlan_untagged', 'vlan_tagged', 'radius_type', 'radius_mode', 'speed', 'mac_limit', 'flow_control', 'dhcp_snooping', 'dhcpv6_snooping', 'arp_protect', 'ra_guard', 'loop_protect')
|
fields = ('name', 'profil_default', 'vlan_untagged', 'vlan_tagged', 'radius_type', 'radius_mode', 'speed', 'mac_limit', 'flow_control', 'dhcp_snooping', 'dhcpv6_snooping', 'arp_protect', 'ra_guard', 'loop_protect', 'vlan_untagged', 'vlan_tagged')
|
||||||
|
|
||||||
|
|
||||||
class ModelSwitchSerializer(NamespacedHMSerializer):
|
class ModelSwitchSerializer(NamespacedHMSerializer):
|
||||||
|
@ -683,17 +692,20 @@ class PortsSerializer(NamespacedHMSerializer):
|
||||||
"""
|
"""
|
||||||
get_port_profil = ProfilSerializer(read_only=True)
|
get_port_profil = ProfilSerializer(read_only=True)
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = topologie.Port
|
model = topologie.Port
|
||||||
fields = ('state', 'port', 'get_port_profil')
|
fields = ('state', 'port', 'get_port_profil')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SwitchPortSerializer(serializers.ModelSerializer):
|
class SwitchPortSerializer(serializers.ModelSerializer):
|
||||||
"""Serialize the data about the switches"""
|
"""Serialize the data about the switches"""
|
||||||
ports = PortsSerializer(many=True, read_only=True)
|
ports = PortsSerializer(many=True, read_only=True)
|
||||||
model = ModelSwitchSerializer(read_only=True)
|
model = ModelSwitchSerializer(read_only=True)
|
||||||
switchbay = SwitchBaySerializer(read_only=True)
|
switchbay = SwitchBaySerializer(read_only=True)
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = topologie.Switch
|
model = topologie.Switch
|
||||||
fields = ('short_name', 'model', 'switchbay', 'ports', 'subnet', 'subnet6')
|
fields = ('short_name', 'model', 'switchbay', 'ports', 'subnet', 'subnet6')
|
||||||
|
|
Loading…
Reference in a new issue