@@ -208,7 +208,7 @@ class RRsetSerializer(ConditionalExistenceModelSerializer):
class Meta:
model = models.RRset
- fields = ('created', 'domain', 'subname', 'name', 'records', 'ttl', 'type',)
+ fields = ('created', 'domain', 'subname', 'name', 'records', 'ttl', 'type', 'touched',)
extra_kwargs = {
'subname': {'required': False, 'default': NonBulkOnlyDefault('')}
}
@@ -141,6 +141,8 @@ class AuthenticatedRRSetTestCase(AuthenticatedRRSetBaseTestCase):
with self.assertPdnsRequests(self.requests_desec_rr_sets_update(name=self.my_empty_domain.name)):
response = self.client.post_rr_set(domain_name=self.my_empty_domain.name, **data)
+ self.assertTrue(all(field in response.data for field in
+ ['created', 'domain', 'subname', 'name', 'records', 'ttl', 'type', 'touched']))
self.assertStatus(response, status.HTTP_201_CREATED)
# Check for uniqueness on second attempt
@@ -43,7 +43,8 @@ A JSON object representing an RRset has the following structure::
"127.0.0.1",
"127.0.0.2"
],
- "ttl": 3600
+ "ttl": 3600,
+ "touched": "2020-04-06T09:24:09.987436Z"
Field details:
@@ -115,6 +116,14 @@ Field details:
.. _RRset types supported by PowerDNS: https://doc.powerdns.com/md/types/
+``touched``
+ :Access mode: read-only
+
+ Timestamp of when the RRset was last touched (same format as ``created``).
+ This field reflects the most recent write request to the RRset. It is also
+ updated when the write request does not actually change anything (e.g.
+ overwriting a DNS record with identical values).
Creating an RRset
~~~~~~~~~~~~~~~~~