1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add customizable NS1 monitor tcp timout settings

This commit is contained in:
Benjamin Kane
2021-10-27 09:04:50 -07:00
parent 0be6a2b74a
commit dd45f74d30
2 changed files with 29 additions and 3 deletions

View File

@@ -1053,6 +1053,16 @@ class Ns1Provider(BaseProvider):
return monitor_id, self._feed_create(monitor)
def _healthcheck_tcp_connect_timeout(self, record):
return record._octodns.get('ns1', {}) \
.get('healthcheck', {}) \
.get('tcp_connect_timeout', 2000)
def _healthcheck_tcp_response_timeout(self, record):
return record._octodns.get('ns1', {}) \
.get('healthcheck', {}) \
.get('tcp_response_timeout', 10000)
def _monitor_gen(self, record, value):
host = record.fqdn[:-1]
_type = record._type
@@ -1064,10 +1074,12 @@ class Ns1Provider(BaseProvider):
ret = {
'active': True,
'config': {
'connect_timeout': 2000,
'connect_timeout':
self._healthcheck_tcp_connect_timeout(record),
'host': value,
'port': record.healthcheck_port,
'response_timeout': 10000,
'response_timeout':
self._healthcheck_tcp_response_timeout(record),
'ssl': record.healthcheck_protocol == 'HTTPS',
},
'frequency': 60,