mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 12:23:11 +00:00
Fix TTL export in API.
This commit is contained in:
parent
15cec0c7f3
commit
f02740189a
1 changed files with 11 additions and 8 deletions
|
@ -342,7 +342,7 @@ class DomainSerializer(NamespacedHMSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.Domain
|
model = machines.Domain
|
||||||
fields = ("interface_parent", "name", "extension", "cname", "api_url")
|
fields = ("interface_parent", "name", "extension", "cname", "api_url", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class IpListSerializer(NamespacedHMSerializer):
|
class IpListSerializer(NamespacedHMSerializer):
|
||||||
|
@ -473,6 +473,7 @@ class OptionalMachineSerializer(NamespacedHMSerializer):
|
||||||
"ipv6_mode",
|
"ipv6_mode",
|
||||||
"create_machine",
|
"create_machine",
|
||||||
"ipv6",
|
"ipv6",
|
||||||
|
"default_dns_ttl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1206,7 +1207,7 @@ class NSRecordSerializer(NsSerializer):
|
||||||
target = serializers.CharField(source="ns", read_only=True)
|
target = serializers.CharField(source="ns", read_only=True)
|
||||||
|
|
||||||
class Meta(NsSerializer.Meta):
|
class Meta(NsSerializer.Meta):
|
||||||
fields = ("target",)
|
fields = ("target", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class MXRecordSerializer(MxSerializer):
|
class MXRecordSerializer(MxSerializer):
|
||||||
|
@ -1217,7 +1218,7 @@ class MXRecordSerializer(MxSerializer):
|
||||||
target = serializers.CharField(source="name", read_only=True)
|
target = serializers.CharField(source="name", read_only=True)
|
||||||
|
|
||||||
class Meta(MxSerializer.Meta):
|
class Meta(MxSerializer.Meta):
|
||||||
fields = ("target", "priority")
|
fields = ("target", "priority", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class TXTRecordSerializer(TxtSerializer):
|
class TXTRecordSerializer(TxtSerializer):
|
||||||
|
@ -1226,7 +1227,7 @@ class TXTRecordSerializer(TxtSerializer):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class Meta(TxtSerializer.Meta):
|
class Meta(TxtSerializer.Meta):
|
||||||
fields = ("field1", "field2")
|
fields = ("field1", "field2", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class SRVRecordSerializer(SrvSerializer):
|
class SRVRecordSerializer(SrvSerializer):
|
||||||
|
@ -1269,10 +1270,11 @@ class ARecordSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
hostname = serializers.CharField(source="domain.name", read_only=True)
|
hostname = serializers.CharField(source="domain.name", read_only=True)
|
||||||
ipv4 = serializers.CharField(source="ipv4.ipv4", read_only=True)
|
ipv4 = serializers.CharField(source="ipv4.ipv4", read_only=True)
|
||||||
|
ttl = serializers.IntegerField(source="domain.ttl", read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.Interface
|
model = machines.Interface
|
||||||
fields = ("hostname", "ipv4")
|
fields = ("hostname", "ipv4", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class AAAARecordSerializer(serializers.ModelSerializer):
|
class AAAARecordSerializer(serializers.ModelSerializer):
|
||||||
|
@ -1282,10 +1284,11 @@ class AAAARecordSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
hostname = serializers.CharField(source="domain.name", read_only=True)
|
hostname = serializers.CharField(source="domain.name", read_only=True)
|
||||||
ipv6 = Ipv6ListSerializer(many=True, read_only=True)
|
ipv6 = Ipv6ListSerializer(many=True, read_only=True)
|
||||||
|
ttl = serializers.IntegerField(source="domain.ttl", read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.Interface
|
model = machines.Interface
|
||||||
fields = ("hostname", "ipv6")
|
fields = ("hostname", "ipv6", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class CNAMERecordSerializer(serializers.ModelSerializer):
|
class CNAMERecordSerializer(serializers.ModelSerializer):
|
||||||
|
@ -1298,7 +1301,7 @@ class CNAMERecordSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.Domain
|
model = machines.Domain
|
||||||
fields = ("alias", "hostname")
|
fields = ("alias", "hostname", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class DNAMERecordSerializer(serializers.ModelSerializer):
|
class DNAMERecordSerializer(serializers.ModelSerializer):
|
||||||
|
@ -1311,7 +1314,7 @@ class DNAMERecordSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.DName
|
model = machines.DName
|
||||||
fields = ("alias", "zone")
|
fields = ("alias", "zone", "ttl")
|
||||||
|
|
||||||
|
|
||||||
class DNSZonesSerializer(serializers.ModelSerializer):
|
class DNSZonesSerializer(serializers.ModelSerializer):
|
||||||
|
|
Loading…
Reference in a new issue