]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Add the protocol (Do53, DoT, DoH, ...) of backends in the API 11673/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 2 Jun 2022 10:05:36 +0000 (12:05 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 2 Jun 2022 10:05:36 +0000 (12:05 +0200)
pdns/dnsdist-web.cc
regression-tests.dnsdist/test_API.py

index 5edc46114f12e1ad377047003850ef95345caae1..3d26d5ce84a3b05f4721376066f3b9bff9b95fed 100644 (file)
@@ -951,6 +951,7 @@ static void addServerToJSON(Json::array& servers, int id, const std::shared_ptr<
     {"name", a->getName()},
     {"address", a->d_config.remote.toStringWithPort()},
     {"state", status},
+    {"protocol", a->getProtocol().toPrettyString()},
     {"qps", (double)a->queryLoad},
     {"qpsLimit", (double)a->qps.getRate()},
     {"outstanding", (double)a->outstanding},
index d58dd7d80f684d61b97e1ccaa1d2c3b22be15a73..3d3b0c64150c8d1a7c8e5a8eddfd710314578852 100644 (file)
@@ -117,7 +117,7 @@ class TestAPIBasics(APITestsBase):
                         'dropRate', 'responses', 'tcpDiedSendingQuery', 'tcpDiedReadingResponse',
                         'tcpGaveUp', 'tcpReadTimeouts', 'tcpWriteTimeouts', 'tcpCurrentConnections',
                         'tcpNewConnections', 'tcpReusedConnections', 'tlsResumptions', 'tcpAvgQueriesPerConnection',
-                        'tcpAvgConnectionDuration']:
+                        'tcpAvgConnectionDuration', 'protocol']:
                 self.assertIn(key, server)
 
             for key in ['id', 'latency', 'weight', 'outstanding', 'qpsLimit', 'reuseds',
@@ -134,10 +134,10 @@ class TestAPIBasics(APITestsBase):
                 self.assertTrue(frontend[key] >= 0)
 
         for pool in content['pools']:
-            for key in ['id', 'name', 'cacheSize', 'cacheEntries', 'cacheHits', 'cacheMisses', 'cacheDeferredInserts', 'cacheDeferredLookups', 'cacheLookupCollisions', 'cacheInsertCollisions', 'cacheTTLTooShorts']:
+            for key in ['id', 'name', 'cacheSize', 'cacheEntries', 'cacheHits', 'cacheMisses', 'cacheDeferredInserts', 'cacheDeferredLookups', 'cacheLookupCollisions', 'cacheInsertCollisions', 'cacheTTLTooShorts', 'cacheCleanupCount']:
                 self.assertIn(key, pool)
 
-            for key in ['id', 'cacheSize', 'cacheEntries', 'cacheHits', 'cacheMisses', 'cacheDeferredInserts', 'cacheDeferredLookups', 'cacheLookupCollisions', 'cacheInsertCollisions', 'cacheTTLTooShorts']:
+            for key in ['id', 'cacheSize', 'cacheEntries', 'cacheHits', 'cacheMisses', 'cacheDeferredInserts', 'cacheDeferredLookups', 'cacheLookupCollisions', 'cacheInsertCollisions', 'cacheTTLTooShorts', 'cacheCleanupCount']:
                 self.assertTrue(pool[key] >= 0)
 
     def testServersLocalhostPool(self):
@@ -167,7 +167,7 @@ class TestAPIBasics(APITestsBase):
                         'dropRate', 'responses', 'tcpDiedSendingQuery', 'tcpDiedReadingResponse',
                         'tcpGaveUp', 'tcpReadTimeouts', 'tcpWriteTimeouts', 'tcpCurrentConnections',
                         'tcpNewConnections', 'tcpReusedConnections', 'tcpAvgQueriesPerConnection',
-                        'tcpAvgConnectionDuration']:
+                        'tcpAvgConnectionDuration', 'protocol']:
                 self.assertIn(key, server)
 
             for key in ['id', 'latency', 'weight', 'outstanding', 'qpsLimit', 'reuseds',