From 610e235ef15f6461aecef2c7bb7052f852460ddb Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 10:48:07 -0600 Subject: [PATCH 1/8] initial commit --- .../traffic_router/core/dns/NameServer.java | 51 ++++++++++--------- .../traffic_router/core/dns/ZoneManager.java | 22 ++++++++ .../webapp/WEB-INF/applicationContext.xml | 20 ++++++++ .../core/dns/NameServerTest.java | 10 ++-- 4 files changed, 75 insertions(+), 28 deletions(-) diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java index 65e029367d..427d680268 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java @@ -42,7 +42,7 @@ @SuppressWarnings("PMD.CyclomaticComplexity") public class NameServer { - private static long negativeCachingTTL = 0L; +// private static long negativeCachingTTL = 0L; private static final int MAX_SUPPORTED_EDNS_VERS = 0; private static final int MAX_ITERATIONS = 6; private static final int NUM_SECTIONS = 4; @@ -328,21 +328,26 @@ private static RRset setNegativeTTL(final RRset original, final int flags) { if (record instanceof SOARecord) { final SOARecord soa = (SOARecord) record; - - // Set the "minimum" attribute to be the maximum of the current minimum value and 900 (seconds) - // This is done to increase the negative caching TTL, so as to maximize the time interval between - // successive NXDOMAIN or NXRRSET responses. - final long minimum = Math.max(soa.getMinimum(), negativeCachingTTL); - final long ttl; - // the value of the minimum field is less than the actual TTL; adjust - if (minimum != 0 || soa.getTTL() > minimum) { - ttl = minimum; - } else { - ttl = soa.getTTL(); - } - record = new SOARecord(soa.getName(), DClass.IN, ttl, soa.getHost(), soa.getAdmin(), - soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), - minimum); +// +// // Set the "minimum" attribute to be the maximum of the current minimum value and 900 (seconds) +// // This is done to increase the negative caching TTL, so as to maximize the time interval between +// // successive NXDOMAIN or NXRRSET responses. +// final long minimum = Math.max(soa.getMinimum(), negativeCachingTTL); +// final long ttl; +// // the value of the minimum field is less than the actual TTL; adjust +// if (minimum != 0 || soa.getTTL() > minimum) { +// ttl = minimum; +// } else { +// ttl = soa.getTTL(); +// } +// record = new SOARecord(soa.getName(), DClass.IN, ttl, soa.getHost(), soa.getAdmin(), +// soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), +// minimum); + if (soa.getMinimum() != 0 || soa.getTTL() > soa.getMinimum()) { + record = new SOARecord(soa.getName(), DClass.IN, soa.getMinimum(), soa.getHost(), soa.getAdmin(), + soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), + soa.getMinimum()); + } // else use the unmodified record } rrset.addRR(record); @@ -442,13 +447,13 @@ public void setTrafficRouterManager(final TrafficRouterManager trafficRouterMana this.trafficRouterManager = trafficRouterManager; } - public long getNegativeCachingTTL() { - return negativeCachingTTL; - } - - public void setNegativeCachingTTL(final long negativeCachingTTL) { - this.negativeCachingTTL = negativeCachingTTL; - } +// public long getNegativeCachingTTL() { +// return negativeCachingTTL; +// } +// +// public void setNegativeCachingTTL(final long negativeCachingTTL) { +// this.negativeCachingTTL = negativeCachingTTL; +// } public void destroy() { /* diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index 17cda2e957..3543fab90f 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -54,6 +54,7 @@ import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.xbill.DNS.AAAARecord; import org.xbill.DNS.ARecord; import org.xbill.DNS.CNAMERecord; @@ -101,6 +102,7 @@ public class ZoneManager extends Resolver { private static final Logger LOGGER = LogManager.getLogger(ZoneManager.class); + private static long negativeCachingTTL = 0L; private final TrafficRouter trafficRouter; private static LoadingCache dynamicZoneCache = null; private static LoadingCache zoneCache = null; @@ -121,6 +123,15 @@ protected enum ZoneCacheType { DYNAMIC, STATIC } + public long getNegativeCachingTTL() { + return negativeCachingTTL; + } + + public void setNegativeCachingTTL(final long negativeCachingTTL) { + this.negativeCachingTTL = negativeCachingTTL; + } + + @Autowired public ZoneManager(final TrafficRouter tr, final StatTracker statTracker, final TrafficOpsUtils trafficOpsUtils, final TrafficRouterManager trafficRouterManager) throws IOException { initTopLevelDomain(tr.getCacheRegister()); initSignatureManager(tr.getCacheRegister(), trafficOpsUtils, trafficRouterManager); @@ -377,6 +388,17 @@ public static Zone loadZone(final ZoneKey zoneKey, final boolean writeZone) thro LOGGER.debug("Attempting to load " + zoneKey.getName()); final Name name = zoneKey.getName(); List records = zoneKey.getRecords(); + System.out.println("negative caching ttl is "+ negativeCachingTTL); + for (int i=0; i < records.size(); i++) { + if (records.get(i).getType() == Type.SOA) { + SOARecord soa = (SOARecord)records.get(i); + soa = new SOARecord(soa.getName(), DClass.IN, soa.getTTL(), soa.getHost(), soa.getAdmin(), + soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), negativeCachingTTL); + records.remove(i); + records.add(i, (Record) soa); + break; + } + } zoneKey.updateTimestamp(); if (zoneKey instanceof SignedZoneKey) { diff --git a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml index 1cb48e73d1..3caf401118 100644 --- a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml +++ b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml @@ -267,6 +267,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java index 627052139d..5c22f8f99a 100644 --- a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java +++ b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java @@ -82,11 +82,11 @@ public void before() throws Exception { ns = new NSRecord(m_an, DClass.IN, 12345L, m_an); } - @Test - public void TestNegativeCachingTTLGetterAndSetter() throws Exception { - nameServer.setNegativeCachingTTL(900L); - assertThat(nameServer.getNegativeCachingTTL(), equalTo(900L)); - } +// @Test +// public void TestNegativeCachingTTLGetterAndSetter() throws Exception { +// nameServer.setNegativeCachingTTL(900L); +// assertThat(nameServer.getNegativeCachingTTL(), equalTo(900L)); +// } @Test public void TestARecordQueryWithClientSubnetOption() throws Exception { From 4ad5456c676601384931de6a880c0d8783ded374 Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 15:02:49 -0600 Subject: [PATCH 2/8] set param to dns neg ttl --- docs/source/admin/traffic_router.rst | 4 +-- .../traffic_router/core/dns/ZoneManager.java | 25 +++++++++---------- .../webapp/WEB-INF/applicationContext.xml | 21 ---------------- .../core/dns/NameServerTest.java | 6 ----- .../core/dns/ZoneManagerUnitTest.java | 10 ++++++++ 5 files changed, 24 insertions(+), 42 deletions(-) diff --git a/docs/source/admin/traffic_router.rst b/docs/source/admin/traffic_router.rst index 8f888b3043..d7179a6afe 100644 --- a/docs/source/admin/traffic_router.rst +++ b/docs/source/admin/traffic_router.rst @@ -128,8 +128,6 @@ For the most part, the configuration files and :term:`Parameters` used by Traffi | | | To disable the queue, set to 0, or to allow an unlimited sized queue, set to -1. | | | +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+ | | dns.zones.dir | Path to automatically generated zone files for reference | ``/opt/traffic_router/var/auto-zones`` | - | +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+ - | | dns.negative.caching.ttl | Value (in seconds) to set as the ``minimum`` for NXDOMAIN and NXRRSET responses | ``900`` | +----------------------------+-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+ | traffic_ops.properties | traffic_ops.username | Username with which to access the :ref:`to-api` | ``admin`` | | | | (must have the ``admin`` :term:`Role`) | | @@ -220,6 +218,8 @@ Much of a Traffic Router's configuration can be obtained through the :term:`Para +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | deepcoveragezone.polling.url | CRConfig.json | The location (URL) where a :term:`Deep Coverage Zone Map` may be found. | +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + | dns.negative.caching.ttl | CRConfig.json | Value (in seconds) to set as the ``minimum`` for NOERROR, NXDOMAIN and NXRRSET responses. Defaults to ``900`` when absent. | + +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | strip.special.query.params | CRConfig.json | If "true", Traffic Router will strip its special query parameters (namely "trred" and "fakeClientIpAddress") from its responses. | | | | Note: the special query parameter "format" is not stripped due to its generality. | +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index 3543fab90f..b03d3cf7d2 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -54,7 +54,6 @@ import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; import org.xbill.DNS.AAAARecord; import org.xbill.DNS.ARecord; import org.xbill.DNS.CNAMERecord; @@ -123,15 +122,6 @@ protected enum ZoneCacheType { DYNAMIC, STATIC } - public long getNegativeCachingTTL() { - return negativeCachingTTL; - } - - public void setNegativeCachingTTL(final long negativeCachingTTL) { - this.negativeCachingTTL = negativeCachingTTL; - } - - @Autowired public ZoneManager(final TrafficRouter tr, final StatTracker statTracker, final TrafficOpsUtils trafficOpsUtils, final TrafficRouterManager trafficRouterManager) throws IOException { initTopLevelDomain(tr.getCacheRegister()); initSignatureManager(tr.getCacheRegister(), trafficOpsUtils, trafficRouterManager); @@ -166,6 +156,13 @@ private void initSignatureManager(final CacheRegister cacheRegister, final Traff ZoneManager.signatureManager = sm; } + public static void setNegativeCachingTTL(final JsonNode config) { + negativeCachingTTL = JsonUtils.optLong(config, "dns.negative.caching.ttl", 900L); + } + public static long getNegativeCachingTTL() { + return negativeCachingTTL; + } + @SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"}) protected static void initZoneCache(final TrafficRouter tr) { synchronized(ZoneManager.class) { @@ -183,6 +180,7 @@ protected static void initZoneCache(final TrafficRouter tr) { final int maintenanceInterval = JsonUtils.optInt(config, "zonemanager.cache.maintenance.interval", 300); // default 5 minutes final int initTimeout = JsonUtils.optInt(config, "zonemanager.init.timeout", 10); + setNegativeCachingTTL(config); final LoadingCache dzc = createZoneCache(ZoneCacheType.DYNAMIC, getDynamicZoneCacheSpec(config, poolSize)); final LoadingCache zc = createZoneCache(ZoneCacheType.STATIC); @@ -388,14 +386,15 @@ public static Zone loadZone(final ZoneKey zoneKey, final boolean writeZone) thro LOGGER.debug("Attempting to load " + zoneKey.getName()); final Name name = zoneKey.getName(); List records = zoneKey.getRecords(); - System.out.println("negative caching ttl is "+ negativeCachingTTL); + // For SOA records, set the "minimum" to the value set in the dns.negative.caching.ttl parameter in + // CRConfig.json. for (int i=0; i < records.size(); i++) { if (records.get(i).getType() == Type.SOA) { SOARecord soa = (SOARecord)records.get(i); soa = new SOARecord(soa.getName(), DClass.IN, soa.getTTL(), soa.getHost(), soa.getAdmin(), - soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), negativeCachingTTL); + soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), getNegativeCachingTTL()); records.remove(i); - records.add(i, (Record) soa); + records.add(i, soa); break; } } diff --git a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml index 3caf401118..f478724088 100644 --- a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml +++ b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml @@ -269,27 +269,6 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java index 5c22f8f99a..95e3216b88 100644 --- a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java +++ b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/NameServerTest.java @@ -82,12 +82,6 @@ public void before() throws Exception { ns = new NSRecord(m_an, DClass.IN, 12345L, m_an); } -// @Test -// public void TestNegativeCachingTTLGetterAndSetter() throws Exception { -// nameServer.setNegativeCachingTTL(900L); -// assertThat(nameServer.getNegativeCachingTTL(), equalTo(900L)); -// } - @Test public void TestARecordQueryWithClientSubnetOption() throws Exception { diff --git a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java index a15e686568..04e740d6c8 100644 --- a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java +++ b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java @@ -54,6 +54,7 @@ import org.xbill.DNS.NSRecord; import org.xbill.DNS.CNAMERecord; +import java.io.File; import java.net.InetAddress; import java.util.ArrayList; import java.util.Arrays; @@ -93,6 +94,15 @@ public void before() throws Exception { } + @Test + public void testNegativeCachingTTLGetterAndSetter() throws Exception { + final File file = new File("src/test/db/cr-config.json"); + final ObjectMapper mapper = new ObjectMapper(); + final JsonNode jo = mapper.readTree(file); + zoneManager.setNegativeCachingTTL(jo); + assertThat(zoneManager.getNegativeCachingTTL(), equalTo(900L)); + } + @Test public void testGetLocalTRHostnameUsesSingleTRHostname() throws Exception { JsonNode trs = new ObjectMapper().readTree("{\"tr-01\": {}}"); From 351bf3485b2b7762ed7b81156afd911936d71baf Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 15:22:56 -0600 Subject: [PATCH 3/8] adding changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0f7563d0..db82bcb80e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7784](https://github.com/apache/trafficcontrol/pull/7784) *Traffic Portal*: Added revert certificate functionality to the ssl-keys page. ### Changed +- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router* Set SOA `minimum` field to a custom value defined in the `dns.negative.caching.ttl` param. - [#7776](https://github.com/apache/trafficcontrol/pull/7776) *tc-health-client*: Added error message while issues interacting with Traffic Ops. - [#7766](https://github.com/apache/trafficcontrol/pull/7766) *Traffic Portal*: now uses Traffic Ops APIv5. - [#7765](https://github.com/apache/trafficcontrol/pull/7765) *Traffic Stats*: now uses Traffic Ops APIv5. From 38b2da866a58d1b514cfc7def514fccbdec1bdbb Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 16:06:18 -0600 Subject: [PATCH 4/8] change param name --- CHANGELOG.md | 2 +- docs/source/admin/traffic_router.rst | 2 -- .../traffic_router/core/dns/NameServer.java | 26 ++----------------- .../traffic_router/core/dns/ZoneManager.java | 4 +-- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db82bcb80e..a8be62b52e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7784](https://github.com/apache/trafficcontrol/pull/7784) *Traffic Portal*: Added revert certificate functionality to the ssl-keys page. ### Changed -- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router* Set SOA `minimum` field to a custom value defined in the `dns.negative.caching.ttl` param. +- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router* Set SOA `minimum` field to a custom value defined in the `tld.soa.minimum` param. - [#7776](https://github.com/apache/trafficcontrol/pull/7776) *tc-health-client*: Added error message while issues interacting with Traffic Ops. - [#7766](https://github.com/apache/trafficcontrol/pull/7766) *Traffic Portal*: now uses Traffic Ops APIv5. - [#7765](https://github.com/apache/trafficcontrol/pull/7765) *Traffic Stats*: now uses Traffic Ops APIv5. diff --git a/docs/source/admin/traffic_router.rst b/docs/source/admin/traffic_router.rst index d7179a6afe..3d6aeb16f3 100644 --- a/docs/source/admin/traffic_router.rst +++ b/docs/source/admin/traffic_router.rst @@ -218,8 +218,6 @@ Much of a Traffic Router's configuration can be obtained through the :term:`Para +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | deepcoveragezone.polling.url | CRConfig.json | The location (URL) where a :term:`Deep Coverage Zone Map` may be found. | +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | dns.negative.caching.ttl | CRConfig.json | Value (in seconds) to set as the ``minimum`` for NOERROR, NXDOMAIN and NXRRSET responses. Defaults to ``900`` when absent. | - +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | strip.special.query.params | CRConfig.json | If "true", Traffic Router will strip its special query parameters (namely "trred" and "fakeClientIpAddress") from its responses. | | | | Note: the special query parameter "format" is not stripped due to its generality. | +-----------------------------------------+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java index 427d680268..91c6fa5cf9 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/NameServer.java @@ -42,7 +42,6 @@ @SuppressWarnings("PMD.CyclomaticComplexity") public class NameServer { -// private static long negativeCachingTTL = 0L; private static final int MAX_SUPPORTED_EDNS_VERS = 0; private static final int MAX_ITERATIONS = 6; private static final int NUM_SECTIONS = 4; @@ -328,21 +327,8 @@ private static RRset setNegativeTTL(final RRset original, final int flags) { if (record instanceof SOARecord) { final SOARecord soa = (SOARecord) record; -// -// // Set the "minimum" attribute to be the maximum of the current minimum value and 900 (seconds) -// // This is done to increase the negative caching TTL, so as to maximize the time interval between -// // successive NXDOMAIN or NXRRSET responses. -// final long minimum = Math.max(soa.getMinimum(), negativeCachingTTL); -// final long ttl; -// // the value of the minimum field is less than the actual TTL; adjust -// if (minimum != 0 || soa.getTTL() > minimum) { -// ttl = minimum; -// } else { -// ttl = soa.getTTL(); -// } -// record = new SOARecord(soa.getName(), DClass.IN, ttl, soa.getHost(), soa.getAdmin(), -// soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), -// minimum); + + // the value of the minimum field is less than the actual TTL; adjust if (soa.getMinimum() != 0 || soa.getTTL() > soa.getMinimum()) { record = new SOARecord(soa.getName(), DClass.IN, soa.getMinimum(), soa.getHost(), soa.getAdmin(), soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), @@ -447,14 +433,6 @@ public void setTrafficRouterManager(final TrafficRouterManager trafficRouterMana this.trafficRouterManager = trafficRouterManager; } -// public long getNegativeCachingTTL() { -// return negativeCachingTTL; -// } -// -// public void setNegativeCachingTTL(final long negativeCachingTTL) { -// this.negativeCachingTTL = negativeCachingTTL; -// } - public void destroy() { /* * Yes, this is odd. We need to call destroy on ZoneManager, but it's static, so diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index b03d3cf7d2..740124f403 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -157,7 +157,7 @@ private void initSignatureManager(final CacheRegister cacheRegister, final Traff } public static void setNegativeCachingTTL(final JsonNode config) { - negativeCachingTTL = JsonUtils.optLong(config, "dns.negative.caching.ttl", 900L); + negativeCachingTTL = JsonUtils.optLong(config, "tld.soa.minimum", 900L); } public static long getNegativeCachingTTL() { return negativeCachingTTL; @@ -386,7 +386,7 @@ public static Zone loadZone(final ZoneKey zoneKey, final boolean writeZone) thro LOGGER.debug("Attempting to load " + zoneKey.getName()); final Name name = zoneKey.getName(); List records = zoneKey.getRecords(); - // For SOA records, set the "minimum" to the value set in the dns.negative.caching.ttl parameter in + // For SOA records, set the "minimum" to the value set in the tld.soa.minimum parameter in // CRConfig.json. for (int i=0; i < records.size(); i++) { if (records.get(i).getType() == Type.SOA) { From 7b563a0b732f5194677d908d24998ef2fdb4b1f1 Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 22:12:19 -0600 Subject: [PATCH 5/8] fix tests --- .../traffic_router/core/dns/ZoneManager.java | 9 +- .../core/dns/ZoneManagerUnitTest.java | 4 +- .../src/test/resources/publish/CrConfig5.json | 1963 +++++++++++++++++ 3 files changed, 1973 insertions(+), 3 deletions(-) create mode 100644 traffic_router/core/src/test/resources/publish/CrConfig5.json diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index 740124f403..81eb748d7f 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -157,7 +157,14 @@ private void initSignatureManager(final CacheRegister cacheRegister, final Traff } public static void setNegativeCachingTTL(final JsonNode config) { - negativeCachingTTL = JsonUtils.optLong(config, "tld.soa.minimum", 900L); + JsonNode node = null; + try { + node = JsonUtils.getJsonNode(JsonUtils.getJsonNode(config, "config"), "soa"); + } catch (JsonUtilsException e) { + e.printStackTrace(); + } finally { + negativeCachingTTL = JsonUtils.optLong(node, "minimum", 900L); + } } public static long getNegativeCachingTTL() { return negativeCachingTTL; diff --git a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java index 04e740d6c8..30e09db522 100644 --- a/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java +++ b/traffic_router/core/src/test/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManagerUnitTest.java @@ -96,11 +96,11 @@ public void before() throws Exception { @Test public void testNegativeCachingTTLGetterAndSetter() throws Exception { - final File file = new File("src/test/db/cr-config.json"); + final File file = new File("src/test/resources/publish/CrConfig5.json"); final ObjectMapper mapper = new ObjectMapper(); final JsonNode jo = mapper.readTree(file); zoneManager.setNegativeCachingTTL(jo); - assertThat(zoneManager.getNegativeCachingTTL(), equalTo(900L)); + assertThat(zoneManager.getNegativeCachingTTL(), equalTo(1200L)); } @Test diff --git a/traffic_router/core/src/test/resources/publish/CrConfig5.json b/traffic_router/core/src/test/resources/publish/CrConfig5.json new file mode 100644 index 0000000000..277d643eec --- /dev/null +++ b/traffic_router/core/src/test/resources/publish/CrConfig5.json @@ -0,0 +1,1963 @@ +{ + "contentServers": { + "edge-cache-000": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-001@xmpp.cdn.example.com", + "fqdn": "edge-cache-001.thecdn.example.com", + "port": "8090", + "ip": "12.34.0.100", + "ip6": "2001:dead:beef:0:C::10/64", + "cacheGroup": "cache-group-0", + "locationId": "location-0", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "https-only-test": ["edge-cache-001.https-only-test.thecdn.example.com"], + "http-only-test": ["edge-cache-001.http-only-test.thecdn.example.com"], + "dns-test": ["edge-cache-001.dns-test.thecdn.example.com"] + } + }, + "edge-cache-001": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-001@xmpp.cdn.example.com", + "fqdn": "edge-cache-001.thecdn.example.com", + "port": "8090", + "ip": "12.34.0.101", + "ip6": "2001:dead:beef:0:C::11/64", + "cacheGroup": "cache-group-0", + "locationId": "location-0", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "https-only-test": ["edge-cache-001.https-only-test.thecdn.example.com"], + "http-only-test": ["edge-cache-001.http-only-test.thecdn.example.com"], + "dns-test": ["edge-cache-001.dns-test.thecdn.example.com"] + } + }, + "edge-cache-002": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-002@xmpp.cdn.example.com", + "fqdn": "edge-cache-002.thecdn.example.com", + "port": "8090", + "ip": "12.34.0.102", + "ip6": "2001:dead:beef:0:C::12/64", + "cacheGroup": "cache-group-0", + "locationId": "location-0", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "https-only-test": ["edge-cache-002.https-only-test.thecdn.example.com"], + "http-only-test": ["edge-cache-001.http-only-test.thecdn.example.com"], + "dns-test": ["edge-cache-001.dns-test.thecdn.example.com"] + } + }, + "edge-cache-010": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-010@xmpp.cdn.example.com", + "fqdn": "edge-cache-010.thecdn.example.com", + "port": "8090", + "ip": "12.34.1.100", + "ip6": "2001:dead:beef:1:C::1A/64", + "cacheGroup": "cache-group-1", + "locationId": "location-1", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-010.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-010.steering-target-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-010.steering-target-1.thecdn.example.com", + "edge-cache-010.steering-target-1-b-b.thecdn.example.com" + ] + } + }, + "edge-cache-011": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-011@xmpp.cdn.example.com", + "fqdn": "edge-cache-011.thecdn.example.com", + "port": "8090", + "ip": "12.34.1.101", + "ip6": "2001:dead:beef:1:C::11/64", + "cacheGroup": "cache-group-1", + "locationId": "location-1", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-011.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-011.steering-target-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-011.steering-target-1.thecdn.example.com", + "edge-cache-011.steering-target-1-b-b.thecdn.example.com" + ] + } + }, + "edge-cache-012": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-012@xmpp.cdn.example.com", + "fqdn": "edge-cache-012.thecdn.example.com", + "port": "8090", + "ip": "12.34.1.102", + "ip6": "2001:dead:beef:1:C::12/64", + "cacheGroup": "cache-group-1", + "locationId": "location-1", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-012.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-012.steering-target-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-012.steering-target-1.thecdn.example.com", + "edge-cache-012.steering-target-1-b-b.thecdn.example.com" + ] + } + }, + "edge-cache-020": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-020@xmpp.cdn.example.com", + "fqdn": "edge-cache-020.thecdn.example.com", + "port": "8090", + "ip": "12.34.2.100", + "ip6": "2001:dead:beef:2:C::1A/64", + "cacheGroup": "cache-group-2", + "locationId": "location-2", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-2": ["edge-cache-020.steering-test-2.thecdn.example.com"], + "client-steering-target-1": ["edge-cache-020.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-020.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-020.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-020.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-020.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-020.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-021": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-021@xmpp.cdn.example.com", + "fqdn": "edge-cache-021.thecdn.example.com", + "port": "8090", + "ip": "12.34.2.101", + "ip6": "2001:dead:beef:2:C::11/64", + "cacheGroup": "cache-group-2", + "locationId": "location-2", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-2": ["edge-cache-021.steering-test-2.thecdn.example.com"], + "client-steering-target-1": ["edge-cache-021.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-021.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-021.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-021.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-021.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-021.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-022": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-022@xmpp.cdn.example.com", + "fqdn": "edge-cache-022.thecdn.example.com", + "port": "8090", + "ip": "12.34.2.102", + "ip6": "2001:dead:beef:2:C::12/64", + "cacheGroup": "cache-group-2", + "locationId": "location-2", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-2": ["edge-cache-022.steering-test-2.thecdn.example.com"], + "client-steering-target-1": ["edge-cache-022.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-022.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-022.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-022.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-022.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-022.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-030": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-030@xmpp.cdn.example.com", + "fqdn": "edge-cache-030.thecdn.example.com", + "port": "8090", + "ip": "12.34.3.100", + "ip6": "2001:dead:beef:3:C::1A/64", + "cacheGroup": "cache-group-3", + "locationId": "location-3", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-030.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-030.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-030.steering-test-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-030.steering-target-1.thecdn.example.com", + "edge-cache-030.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-030.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-030.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-030.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-030.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-030.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-030.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-031": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-031@xmpp.cdn.example.com", + "fqdn": "edge-cache-031.thecdn.example.com", + "port": "8090", + "ip": "12.34.3.101", + "ip6": "2001:dead:beef:3:C::11/64", + "cacheGroup": "cache-group-3", + "locationId": "location-3", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-031.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-031.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-031.steering-test-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-031.steering-target-1.thecdn.example.com", + "edge-cache-031.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-031.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-031.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-031.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-031.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-031.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-031.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-032": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-032@xmpp.cdn.example.com", + "fqdn": "edge-cache-032.thecdn.example.com", + "port": "8090", + "ip": "12.34.3.102", + "ip6": "2001:dead:beef:3:C::12/64", + "cacheGroup": "cache-group-3", + "locationId": "location-3", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-032.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-032.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-032.steering-test-2.thecdn.example.com"], + "steering-target-1": [ + "edge-cache-032.steering-target-1.thecdn.example.com", + "edge-cache-032.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-032.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-032.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-032.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-032.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-032.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-032.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-040": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-040@xmpp.cdn.example.com", + "fqdn": "edge-cache-040.thecdn.example.com", + "port": "8090", + "ip": "12.34.4.100", + "ip6": "2001:dead:beef:4:C::1A/64", + "cacheGroup": "cache-group-4", + "locationId": "location-4", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-040.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-040.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-040.steering-test-2.thecdn.example.com"], + "federation-test": [ + "edge.federation-test.thecdn.example.com", + "edge.dee-ehs-06.thecdn.example.com" + ], + "steering-target-1": [ + "edge-cache-040.steering-target-1.thecdn.example.com", + "edge-cache-040.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-040.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-040.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-040.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-040.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-040.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-040.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-041": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-041@xmpp.cdn.example.com", + "fqdn": "edge-cache-041.thecdn.example.com", + "port": "8090", + "ip": "12.34.4.101", + "ip6": "2001:dead:beef:4:C::11/64", + "cacheGroup": "cache-group-4", + "locationId": "location-4", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-041.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-041.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-041.steering-test-2.thecdn.example.com"], + "federation-test": [ + "edge.federation-test.thecdn.example.com", + "edge.dee-ehs-06.thecdn.example.com" + ], + "steering-target-1": [ + "edge-cache-041.steering-target-1.thecdn.example.com", + "edge-cache-041.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-041.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-041.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-041.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-041.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-041.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-041.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-042": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-042@xmpp.cdn.example.com", + "fqdn": "edge-cache-042.thecdn.example.com", + "port": "8090", + "ip": "12.34.4.102", + "ip6": "2001:dead:beef:4:C::12/64", + "cacheGroup": "cache-group-4", + "locationId": "location-4", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "steering-test-1": ["edge-cache-042.steering-test-1.thecdn.example.com"], + "steering-target-2": ["edge-cache-042.steering-target-2.thecdn.example.com"], + "steering-test-2": ["edge-cache-042.steering-test-2.thecdn.example.com"], + "federation-test": [ + "edge.federation-test.thecdn.example.com", + "edge.dee-ehs-06.thecdn.example.com" + ], + "steering-target-1": [ + "edge-cache-042.steering-target-1.thecdn.example.com", + "edge-cache-042.steering-target-1-b-b.thecdn.example.com" + ], + "client-steering-target-1": ["edge-cache-042.client-steering-target-1.thecdn.example.com"], + "client-steering-target-2": ["edge-cache-042.client-steering-target-2.thecdn.example.com"], + "client-steering-target-3": ["edge-cache-042.client-steering-target-3.thecdn.example.com"], + "client-steering-target-4": ["edge-cache-042.client-steering-target-4.thecdn.example.com"], + "steering-target-4": ["edge-cache-042.steering-target-4.thecdn.example.com"], + "steering-target-3": ["edge-cache-042.steering-target-3.thecdn.example.com"] + } + }, + "edge-cache-070": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-070@xmpp.cdn.example.com", + "fqdn": "edge-cache-070.thecdn.example.com", + "port": "8090", + "ip": "12.34.7.100", + "ip6": "2001:dead:beef:7:C::1A/64", + "cacheGroup": "cache-group-7", + "locationId": "location-7", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-to-https-test": ["edge-cache-070.http-to-https-test.thecdn.example.com"] + } + }, + "edge-cache-071": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-071@xmpp.cdn.example.com", + "fqdn": "edge-cache-071.thecdn.example.com", + "port": "8090", + "ip": "12.34.7.101", + "ip6": "2001:dead:beef:7:C::11/64", + "cacheGroup": "cache-group-7", + "locationId": "location-7", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-to-https-test": ["edge-cache-071.http-to-https-test.thecdn.example.com"] + } + }, + "edge-cache-072": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-072@xmpp.cdn.example.com", + "fqdn": "edge-cache-072.thecdn.example.com", + "port": "8090", + "ip": "12.34.7.102", + "ip6": "2001:dead:beef:7:C::12/64", + "cacheGroup": "cache-group-7", + "locationId": "location-7", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-to-https-test": [ "edge-cache-072.http-to-https-test.thecdn.example.com"] + } + }, + "edge-cache-080": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-080@xmpp.cdn.example.com", + "fqdn": "edge-cache-080.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.100", + "ip6": "2001:dead:beef:8:C::1A/64", + "cacheGroup": "cache-group-8", + "locationId": "location-8", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-and-https-test": ["edge-cache-080.http-and-https-test.thecdn.example.com"] + } + }, + "edge-cache-081": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-081@xmpp.cdn.example.com", + "fqdn": "edge-cache-081.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.101", + "ip6": "2001:dead:beef:8:C::11/64", + "cacheGroup": "cache-group-8", + "locationId": "location-8", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-and-https-test": ["edge-cache-081.http-and-https-test.thecdn.example.com"] + } + }, + "edge-cache-082": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-082@xmpp.cdn.example.com", + "fqdn": "edge-cache-082.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.102", + "ip6": "2001:dead:beef:8:C::12/64", + "cacheGroup": "cache-group-8", + "locationId": "location-8", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "http-and-https-test": [ "edge-cache-082.http-and-https-test.thecdn.example.com"] + } + }, + "edge-cache-csd-1": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-csd-1@xmpp.cdn.example.com", + "fqdn": "edge-cache-csd-1.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.201", + "ip6": "2001:dead:beef:8:C::81/64", + "cacheGroup": "cache-group-csd", + "locationId": "location-csd", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "csd-target-1": ["edge-cache-csd-1.csd-target-1.thecdn.example.com"], + "csd-target-2": ["edge-cache-csd-1.csd-target-2.thecdn.example.com"], + "csd-target-3": ["edge-cache-csd-1.csd-target-3.thecdn.example.com"], + "csd-target-4": ["edge-cache-csd-1.csd-target-4.thecdn.example.com"], + "csd-target-5": ["edge-cache-csd-1.csd-target-5.thecdn.example.com"] + } + }, + "edge-cache-csd-2": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-csd-2@xmpp.cdn.example.com", + "fqdn": "edge-cache-csd-2.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.202", + "ip6": "2001:dead:beef:8:C::82/64", + "cacheGroup": "cache-group-csd", + "locationId": "location-csd", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "csd-target-1": ["edge-cache-csd-2.csd-target-1.thecdn.example.com"], + "csd-target-2": ["edge-cache-csd-2.csd-target-2.thecdn.example.com"], + "csd-target-3": ["edge-cache-csd-2.csd-target-3.thecdn.example.com"], + "csd-target-4": ["edge-cache-csd-2.csd-target-4.thecdn.example.com"], + "csd-target-5": ["edge-cache-csd-2.csd-target-5.thecdn.example.com"] + } + }, + "edge-cache-csd-3": { + "type": "EDGE", + "profile": "EDGE_STATIC", + "status": "REPORTED", + "hashId": "edge-cache-csd-3@xmpp.cdn.example.com", + "fqdn": "edge-cache-csd-3.thecdn.example.com", + "port": "8090", + "ip": "12.34.8.203", + "ip6": "2001:dead:beef:8:C::83/64", + "cacheGroup": "cache-group-csd", + "locationId": "location-csd", + "hashCount": 1000, + "interfaceName": "bond0", + "deliveryServices": { + "csd-target-1": ["edge-cache-csd-3.csd-target-1.thecdn.example.com"], + "csd-target-2": ["edge-cache-csd-3.csd-target-2.thecdn.example.com"], + "csd-target-3": ["edge-cache-csd-3.csd-target-3.thecdn.example.com"], + "csd-target-4": ["edge-cache-csd-3.csd-target-4.thecdn.example.com"], + "csd-target-5": ["edge-cache-csd-3.csd-target-5.thecdn.example.com"] + } + } + }, + "contentRouters": { + "testing-tr-02": { + "port": "80", + "status": "ONLINE", + "location": "dc-chicago", + "ip6": "2001:dead:beef:123:1::2", + "api.port": "3333", + "fqdn": "testing-tr-02.cdn.example.com", + "ip": "12.34.20.2", + "profile": "ROUTER_TEST" + }, + "testing-tr-01": { + "port": "80", + "status": "ONLINE", + "location": "dc-chicago", + "ip6": "2001:dead:beef:123:1::1", + "api.port": "3333", + "fqdn": "testing-tr-01.cdn.example.com", + "ip": "12.34.20.1", + "profile": "ROUTER_TEST" + }, + "edge-testing-tr-08": { + "port": "80", + "status": "ONLINE", + "location": "location-9", + "ip6": "2001:dead:beef:124:1::8", + "api.port": "3333", + "fqdn": "edge-testing-tr-08.cdn.example.com", + "ip": "12.34.21.8", + "profile": "ROUTER_TEST" + }, + + "edge-testing-tr-06": { + "port": "80", + "status": "ONLINE", + "location": "location-9", + "ip6": "2001:dead:beef:124:1::6", + "api.port": "3333", + "fqdn": "edge-testing-tr-06.cdn.example.com", + "ip": "12.34.21.6", + "profile": "ROUTER_TEST" + }, + + "edge-testing-tr-07": { + "port": "80", + "status": "ONLINE", + "location": "location-9", + "ip6": "2001:dead:beef:124:1::7", + "api.port": "3333", + "fqdn": "edge-testing-tr-07.cdn.example.com", + "ip": "12.34.21.7", + "profile": "ROUTER_TEST" + }, + + "edge-testing-tr-01": { + "port": "80", + "status": "ONLINE", + "location": "location-0", + "ip6": "2001:dead:beef:124:1::1", + "api.port": "3333", + "fqdn": "edge-testing-tr-01.cdn.example.com", + "ip": "12.34.21.1", + "profile": "ROUTER_TEST" + }, + + "edge-testing-tr-03": { + "port": "80", + "status": "ONLINE", + "location": "location-0", + "ip6": "2001:dead:beef:124:1::3", + "api.port": "3333", + "fqdn": "edge-testing-tr-03.cdn.example.com", + "ip": "12.34.21.3", + "profile": "ROUTER_TEST" + }, + "edge-testing-tr-04": { + "port": "80", + "status": "ONLINE", + "location": "location-0", + "ip6": "2001:dead:beef:124:1::4", + "api.port": "3333", + "fqdn": "edge-testing-tr-04.cdn.example.com", + "ip": "12.34.21.4", + "profile": "ROUTER_TEST" + }, + "edge-testing-tr-02": { + "port": "80", + "status": "ONLINE", + "location": "location-0", + "ip6": "2001:dead:beef:124:1::2", + "api.port": "3333", + "fqdn": "edge-testing-tr-02.cdn.example.com", + "ip": "12.34.21.2", + "profile": "ROUTER_TEST" + }, + "edge-testing-tr-05": { + "port": "80", + "status": "ONLINE", + "location": "location-9", + "ip6": "2001:dead:beef:124:1::5", + "api.port": "3333", + "fqdn": "edge-testing-tr-05.cdn.example.com", + "ip": "12.34.21.5", + "profile": "ROUTER_TEST" + } + }, + "monitors": { + "testing-tmonitor-02": { + "port": "80", + "status": "ONLINE", + "location": "location-2", + "ip6": "2001:dead:beef:123:1::6/64", + "fqdn": "testing-tmonitor-02.cdn.example.com", + "ip": "12.34.1.200", + "profile": "MONITOR_TEST" + }, + "testing-tmonitor-01": { + "port": "80", + "status": "ONLINE", + "location": "location-4", + "ip6": "2001:dead:beef:123:1::5/64", + "fqdn": "testing-tmonitor-01.cdn.example.com", + "ip": "12.34.1.201", + "profile": "MONITOR_TEST" + } + }, + "deliveryServices": { + "https-only-test": { + "sslEnabled": "true", + "consistentHashRegex": "/.*?(/.*?/).*?(.m3u8)", + "protocol": { + "acceptHttp" : "false", + "acceptHttps" : "true", + "redirectToHttps" : "false" + }, + "domains": ["https-only-test.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "false", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.https-only-test\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "admin@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService" + }, + "client-steering-test-1": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": ["X-MoneyTrace"], + "domains": ["client-steering-test-1.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "true", + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "client-steering-test-1.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-test-1\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "staticDnsEntries": [] + }, + "client-steering-test-2": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": ["X-MoneyTrace"], + "domains": ["client-steering-test-2.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "true", + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "client-steering-test-2.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-test-2\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "staticDnsEntries": [] + }, + "client-steering-diversity-test": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": ["X-MoneyTrace"], + "domains": ["client-steering-diversity-test.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "true", + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "client-steering-diversity-test.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "cdn", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-diversity-test\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "staticDnsEntries": [] + }, + "csd-target-1": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "deepCachingType": "ALWAYS", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["csd-target-1.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "cdn", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.csd-target-1\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "csd-target-2": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "deepCachingType": "ALWAYS", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["csd-target-2.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "cdn", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.csd-target-2\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "csd-target-3": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "deepCachingType": "ALWAYS", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["csd-target-3.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "cdn", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.csd-target-3\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "csd-target-4": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["csd-target-4.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "cdn", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.csd-target-4\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "csd-target-5": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["csd-target-5.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "cdn", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.csd-target-5\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "client-steering-target-1": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["client-steering-target-1.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-target-1\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "client-steering-target-2": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["client-steering-target-2.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-target-2\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "client-steering-target-3": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["client-steering-target-3.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-target-3\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "client-steering-target-4": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["client-steering-target-4.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.client-steering-target-4\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "steering-test-1": { + "sslEnabled": "false", + "consistentHashRegex": "/.*?(/.*?/).*?(.m3u8)", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": ["X-MoneyTrace"], + "domains": ["steering-test-1.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "true", + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "steering-test-1.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-test-1\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "staticDnsEntries": [ + { + "name": "mm", + "value": "10.20.30.42", + "type": "A", + "ttl": "7200" + }, + { + "name": "mm-cname", + "value": "mm.steering-test-1.thecdn.example.com.", + "type": "CNAME", + "ttl": "7200" + } + ] + }, + "steering-target-2": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "steering-target-2.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["steering-target-2.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-target-2\\..*", + "match-type": "HOST" + }] + }], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "steering-test-2": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "dispersion": { + "limit": 2, + "shuffled": "true" + }, + "domains": ["test.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.test\\..*", + "match-type": "HOST" + }] + }], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "responseHeaders": { + "Foo": "bar", + "Yes": "indeed" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "true" + }, + "federation-test": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "bypassDestination": {"DNS": {"ttl": "30"}}, + "domains": ["federation-test.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "edge", + "matchsets": [ + { + "protocol": "DNS", + "matchlist": [{ + "regex": ".*\\.federation-test\\..*", + "match-type": "HOST" + }] + }, + { + "protocol": "DNS", + "matchlist": [{ + "regex": ".*\\.dee-ehs-06\\..*", + "match-type": "HOST" + }] + } + ], + "ttls": { + "AAAA": "30", + "SOA": "7200", + "A": "30", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "30", + "staticDnsEntries": [{ + "name": "mm", + "value": "foo.bar.baz.net.", + "type": "CNAME", + "ttl": "30" + }], + "maxDnsIpsForLocation": "0", + "ip6RoutingEnabled": "true" + }, + "steering-target-1": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "requestHeaders": [ + "User-Agent", + "MyHeader", + "Date" + ], + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["steering-target-1.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [ + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-target-1\\..*", + "match-type": "HOST" + }] + }, + { + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-target-1-b-b\\..*", + "match-type": "HOST" + }] + } + ], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "3 0", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "steering-target-4": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "steering-target-4.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["steering-target-4.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-target-4\\..*", + "match-type": "HOST" + }] + }], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "steering-target-3": { + "sslEnabled": "false", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "bypassDestination": {"HTTP": { + "port": "80", + "fqdn": "steering-target-3.overflowcdn.net" + }}, + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "domains": ["steering-target-3.thecdn.example.com"], + "coverageZoneOnly": "false", + "routingName": "tr", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.steering-target-3\\..*", + "match-type": "HOST" + }] + }], + "regionalGeoBlocking": "false", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "geoEnabled": [{"countryCode": "US"}], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "3600", + "ip6RoutingEnabled": "false" + }, + "http-and-https-test": { + "sslEnabled": "true", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "true", + "redirectToHttps" : "false" + }, + "domains": ["http-and-https-test.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "false", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.http-and-https-test\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "admin@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService" + }, + "http-to-https-test": { + "sslEnabled": "true", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "true", + "redirectToHttps" : "true" + }, + "domains": ["http-to-https-test.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "false", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.http-to-https-test\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "admin@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService" + }, + "http-only-test": { + "sslEnabled": "true", + "protocol": { + "acceptHttp" : "true", + "acceptHttps" : "false", + "redirectToHttps" : "false" + }, + "domains": ["http-only-test.thecdn.example.com"], + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "NS": "3600" + }, + "ttl": "3600", + "ip6RoutingEnabled": "true", + "dispersion": { + "limit": 1, + "shuffled": "true" + }, + "coverageZoneOnly": "false", + "routingName": "tr", + "regionalGeoBlocking": "false", + "matchsets": [{ + "protocol": "HTTP", + "matchlist": [{ + "regex": ".*\\.http-only-test\\..*", + "match-type": "HOST" + }] + }], + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "admin@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService" + }, + "dns-test": { + "sslEnabled": "false", + "bypassDestination": { + "DNS": { + "ttl": "30", + "cname": "www.example.com" + } + }, + "domains": [ + "dns-test.thecdn.example.com" + ], + "coverageZoneOnly": "false", + "routingName": "edge", + "matchsets": [{ + "protocol": "DNS", + "matchlist": [{ + "regex": ".*\\.dns-test\\..*", + "match-type": "HOST" + }] + }], + "ttls": { + "AAAA": "30", + "SOA": "7200", + "A": "30", + "NS": "3600" + }, + "missLocation": { + "long": "-87.627778", + "lat": "41.881944" + }, + "soa": { + "expire": "604800", + "minimum": "30", + "admin": "admin@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "geolocationProvider": "maxmindGeolocationService", + "ttl": "30", + "maxDnsIpsForLocation": "2", + "ip6RoutingEnabled": "false" + } + }, + "stats": { + "tm_version": "1.5.0-3027.8d600a8e", + "CDN_name": "thecdn", + "tm_user": "admin1", + "date": 1465084800, + "tm_host": "localhost:8889" + }, + "edgeLocations": { + "location-0": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -107.480250, + "latitude": 40.117800 + }, + "location-1": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -121.0, + "latitude": 49.0 + }, + "location-2": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -111.0, + "latitude": 49.0 + }, + "location-3": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -101.0, + "latitude": 49.0 + }, + "location-4": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -91.0, + "latitude": 49.0 + }, + "location-7": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -66.0, + "latitude": 36.0 + }, + "location-8": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -76.0, + "latitude": 36.0 + }, + "location-9": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -86.0, + "latitude": 36.0 + }, + "location-csd": { + "localizationMethods": ["CZ", "DEEP_CZ", "GEO"], + "longitude": -87.0, + "latitude": 37.0 + } + }, + "trafficRouterLocations": { + "location-0": { + "longitude": -84.0, + "latitude": 33.0 + }, + "location-9": { + "longitude": -87.0, + "latitude": 41.0 + } + }, + "config": { + "certificate.api.url": "http://${toHostname}/api/5.0/cdns/name/${cdnName}/sslkeys", + "dnschallengemapping.polling.url": "http://${toHostname}/api/5.0/dnsrecords/", + "dnschallengemapping.polling.interval": "600000", + "federationmapping.polling.url": "http://${toHostname}/api/5.0/federations/all", + "federationmapping.polling.interval": "600000", + "steeringmapping.polling.url": "http://${toHostname}/api/5.0/steering", + "steeringmapping.polling.interval": "15000", + "weight": "1.0", + "requestHeaders": [ + "Accept", + "Date" + ], + "thecdn.dnssec.inception": "1429649333", + "geolocation.polling.url": "http://localhost:8889/geo/GeoLite2-City.mmdb.gz", + "geolocation.polling.interval": "86400000", + "ttls": { + "AAAA": "3600", + "SOA": "7200", + "A": "3600", + "DS": "60", + "NS": "3600" + }, + "coveragezone.polling.interval": "86400000", + "regional_geoblock.polling.url.renamed": "http://testing-tm-01.cdn.example.com/some/path", + "keystore.auth.url": "http://localhost:3000/api/5.0/user/login", + "neustar.polling.interval": "12800000", + "geolocation6.polling.interval": "86400000", + "domain_name": "thecdn.example.com", + "consistent.dns.routing": "false", + "soa": { + "expire": "604800", + "minimum": "1200", + "admin": "operations@thecdn.example.com", + "retry": "7200", + "refresh": "28800" + }, + "coveragezone.polling.url": "http://localhost:8889/czf.json", + "deepcoveragezone.polling.url": "http://localhost:8889/dczmap.json", + "api.auth.url": "http://${toHostname}/api/5.0/user/login", + "certificates.polling.interval": "10000", + "dnssec.enabled": "false", + "edge.dns.routing": "true", + "edge.http.routing": "true" + } +} From 6164e3f83832816fe30c268ecf212a1858c1bc9e Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 22:13:01 -0600 Subject: [PATCH 6/8] modify changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8be62b52e..d90a2e9388 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7784](https://github.com/apache/trafficcontrol/pull/7784) *Traffic Portal*: Added revert certificate functionality to the ssl-keys page. ### Changed -- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router* Set SOA `minimum` field to a custom value defined in the `tld.soa.minimum` param. +- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router*: Set SOA `minimum` field to a custom value defined in the `tld.soa.minimum` param. - [#7776](https://github.com/apache/trafficcontrol/pull/7776) *tc-health-client*: Added error message while issues interacting with Traffic Ops. - [#7766](https://github.com/apache/trafficcontrol/pull/7766) *Traffic Portal*: now uses Traffic Ops APIv5. - [#7765](https://github.com/apache/trafficcontrol/pull/7765) *Traffic Stats*: now uses Traffic Ops APIv5. From 8e0f473474717454aecae7764e9a2bf39611545e Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Thu, 21 Sep 2023 22:17:58 -0600 Subject: [PATCH 7/8] fix pmd --- .../traffic_control/traffic_router/core/dns/ZoneManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index 81eb748d7f..da5f21f391 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -161,7 +161,7 @@ public static void setNegativeCachingTTL(final JsonNode config) { try { node = JsonUtils.getJsonNode(JsonUtils.getJsonNode(config, "config"), "soa"); } catch (JsonUtilsException e) { - e.printStackTrace(); + LOGGER.warn("Couldn't find a JSON node for config or soa; continuing by setting the minimum value to 900", e); } finally { negativeCachingTTL = JsonUtils.optLong(node, "minimum", 900L); } From a61eb7c55c6b0526fbe3de5643eb36f8dd6377f4 Mon Sep 17 00:00:00 2001 From: Srijeet Chatterjee Date: Tue, 26 Sep 2023 09:44:41 -0600 Subject: [PATCH 8/8] code review --- CHANGELOG.md | 2 +- .../traffic_control/traffic_router/core/dns/ZoneManager.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90a2e9388..cb7afed34d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7784](https://github.com/apache/trafficcontrol/pull/7784) *Traffic Portal*: Added revert certificate functionality to the ssl-keys page. ### Changed -- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router*: Set SOA `minimum` field to a custom value defined in the `tld.soa.minimum` param. - [#7776](https://github.com/apache/trafficcontrol/pull/7776) *tc-health-client*: Added error message while issues interacting with Traffic Ops. - [#7766](https://github.com/apache/trafficcontrol/pull/7766) *Traffic Portal*: now uses Traffic Ops APIv5. - [#7765](https://github.com/apache/trafficcontrol/pull/7765) *Traffic Stats*: now uses Traffic Ops APIv5. @@ -182,6 +181,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7697](https://github.com/apache/trafficcontrol/pull/7697) *Traffic Ops*: Fixed `iloPassword` and `xmppPassword` checking for priv-level instead of using permissions. ### Removed +- [#7808](https://github.com/apache/trafficcontrol/pull/7808) *Traffic Router*: Set SOA `minimum` field to a custom value defined in the `tld.soa.minimum` param, and remove the previously added `dns.negative.caching.ttl` property. - [#7804](https://github.com/apache/trafficcontrol/pull/7804) Removed unneeded V5 client methods for `deliveryServiceRequiredcapabilities`. - [#7271](https://github.com/apache/trafficcontrol/pull/7271) Removed components in `infrastructre/docker/`, not in use as cdn-in-a-box performs the same functionality. - [#7271](https://github.com/apache/trafficcontrol/pull/7271) Removed `misc/jira_github_issue_import.py`, the project does not use JIRA. diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java index da5f21f391..a4ba655cd0 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java @@ -398,10 +398,9 @@ public static Zone loadZone(final ZoneKey zoneKey, final boolean writeZone) thro for (int i=0; i < records.size(); i++) { if (records.get(i).getType() == Type.SOA) { SOARecord soa = (SOARecord)records.get(i); - soa = new SOARecord(soa.getName(), DClass.IN, soa.getTTL(), soa.getHost(), soa.getAdmin(), + soa = new SOARecord(soa.getName(), soa.getDClass(), soa.getTTL(), soa.getHost(), soa.getAdmin(), soa.getSerial(), soa.getRefresh(), soa.getRetry(), soa.getExpire(), getNegativeCachingTTL()); - records.remove(i); - records.add(i, soa); + records.set(i, soa); break; } }