Adding initial files

This commit is contained in:
2021-12-20 21:06:31 +00:00
committed by root
parent d00ee614d6
commit 3d93bfa7df
7 changed files with 113 additions and 0 deletions

15
DnsRecordDeleter.py Normal file
View File

@ -0,0 +1,15 @@
import requests
from Logger import load_logger
from GandiAuthenticationHeader import get_authentication_headers
logger = load_logger()
headers = get_authentication_headers()
LIVEDNS_API_URL = 'https://api.gandi.net/v5/livedns/domains'
def delete_dns_record(subdomain, domain):
response = requests.delete(LIVEDNS_API_URL + '/' + domain
+ '/records/' + subdomain, headers=headers)
if not response.ok:
logger.error(response.raise_for_status())
exit(1)