From: Remi Gacogne Date: Thu, 2 Jun 2022 10:05:36 +0000 (+0200) Subject: dnsdist: Add the protocol (Do53, DoT, DoH, ...) of backends in the API X-Git-Tag: auth-4.8.0-alpha0~81^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11673%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Add the protocol (Do53, DoT, DoH, ...) of backends in the API --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 5edc46114f..3d26d5ce84 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -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}, diff --git a/regression-tests.dnsdist/test_API.py b/regression-tests.dnsdist/test_API.py index d58dd7d80f..3d3b0c6415 100644 --- a/regression-tests.dnsdist/test_API.py +++ b/regression-tests.dnsdist/test_API.py @@ -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',