mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 03:43:12 +00:00
Déplacé dans une MR ultérieure
This commit is contained in:
parent
4679bbe604
commit
6202ddd0fa
1 changed files with 0 additions and 35 deletions
|
@ -623,41 +623,6 @@ class ServiceRegenSerializer(NamespacedHMSerializer):
|
||||||
'api_url': {'view_name': 'serviceregen-detail'}
|
'api_url': {'view_name': 'serviceregen-detail'}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Switches et ports
|
|
||||||
|
|
||||||
class InterfaceVlanSerializer(NamespacedHMSerializer):
|
|
||||||
domain = serializers.CharField(read_only=True)
|
|
||||||
ipv4 = serializers.CharField(read_only=True)
|
|
||||||
ipv6 = Ipv6ListSerializer(read_only=True, many=True)
|
|
||||||
vlan_id = serializers.IntegerField(source='type.ip_type.vlan.vlan_id', read_only=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = machines.Interface
|
|
||||||
fields = ('ipv4', 'ipv6', 'domain', 'vlan_id')
|
|
||||||
|
|
||||||
class InterfaceRoleSerializer(NamespacedHMSerializer):
|
|
||||||
interface = InterfaceVlanSerializer(source='machine.interface_set', read_only=True, many=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = machines.Interface
|
|
||||||
fields = ('interface',)
|
|
||||||
|
|
||||||
|
|
||||||
class RoleSerializer(NamespacedHMSerializer):
|
|
||||||
"""Serialize `machines.models.OuverturePort` objects.
|
|
||||||
"""
|
|
||||||
servers = InterfaceRoleSerializer(read_only=True, many=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = machines.Role
|
|
||||||
fields = ('role_type', 'servers', 'specific_role')
|
|
||||||
|
|
||||||
|
|
||||||
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_untagged = VlanSerializer(read_only=True)
|
||||||
|
|
Loading…
Reference in a new issue