]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remote: Support ::alsoNotifies
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 14 Jan 2020 13:59:23 +0000 (14:59 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 14 Jan 2020 14:21:05 +0000 (15:21 +0100)
docs/backends/remote.rst
modules/remotebackend/remotebackend.cc
modules/remotebackend/remotebackend.hh

index 49e74b4afc048a5bcb024812d9ca8e0e4d5966fc..6cb2653cc10069508698a12cf90e540440dbc582 100644 (file)
@@ -144,6 +144,11 @@ in this array will be logged in PowerDNS at loglevel ``info`` (6).
 Methods
 ^^^^^^^
 
+Methods required for different features
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+:Always required: ``initialize``, ``lookup``
+:Master operation: ``list``, ``getUpdatedMasters``, ``setNotified``
+
 ``initialize``
 ~~~~~~~~~~~~~~
 
@@ -958,12 +963,13 @@ Alternative response
 
 ``createSlaveDomain``
 ~~~~~~~~~~~~~~~~~~~~~
-
 Creates new domain. This method is called when NOTIFY is received and
 you are superslaving.
 
-Mandatory: No Parameters: ip, domain Optional parameters: nameserver,
-account Reply: true for success, false for failure
+ - Mandatory: No
+ - Parameters: ip, domain
+ - Optional parameters: nameserver, account
+ - Reply: true for success, false for failure
 
 Example JSON/RPC
 ''''''''''''''''
@@ -1516,7 +1522,7 @@ Used to find out any updates to master domains. This is used to trigger notifica
 
 -  Mandatory: no
 -  Parameters: none
--  Reply: array of DomainInfo
+-  Reply: array of DomainInfo or at least the ``id``, ``zone``, ``serial`` and ``notified_serial`` fields
 
 Example JSON/RPC
 ''''''''''''''''
index 6d7f34437f78b6410377a55ebb871af4b87a7975..2c20cd306a678bddea867ba3ea95a118b5542b21 100644 (file)
@@ -904,6 +904,13 @@ void RemoteBackend::getAllDomains(vector<DomainInfo> *domains, bool include_disa
   }
 }
 
+void RemoteBackend::alsoNotifies(const DNSName &domain, set<string> *ips)
+{
+  std::vector<std::string> meta;
+  getDomainMetadata(domain, "ALSO-NOTIFY", meta);
+  ips->insert(meta.begin(), meta.end());
+}
+
 void RemoteBackend::getUpdatedMasters(vector<DomainInfo>* domains)
 {
   Json query = Json::object{
index c453c52e99e002ae5cb3c981feedda911ad7cb7c..647da8cdd953744bf60cc6d9f883471aeff465a9 100644 (file)
@@ -189,6 +189,7 @@ class RemoteBackend : public DNSBackend
   bool searchComments(const string &pattern, int maxResults, vector<Comment>& result) override;
   void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
   void getUpdatedMasters(vector<DomainInfo>* domains) override;
+  void alsoNotifies(const DNSName &domain, set<string> *ips) override;
 
   static DNSBackend *maker();