Added login_test method

This commit is contained in:
2019-10-14 21:17:34 +00:00
parent 1e14831cab
commit 27ec57adbf

View File

@@ -60,6 +60,14 @@ class DirectAdminClient:
'message': response['text'][0]
}
def login_test(self):
r = self.make_request('CMD_API_LOGIN_TEST')
response = parse_qs(r.read().decode('utf8'),
keep_blank_values=0,
strict_parsing=1)
return self.__process_response__(response)
def get_domain_list(self):
r = self.make_request('CMD_API_SHOW_DOMAINS')
@@ -86,6 +94,7 @@ class DirectAdminClient:
('value', record_value)])
if record_ttl is not None:
# Non-default is specified so we should add on the record
params.update({'ttl': record_ttl})
response = self.make_request('CMD_API_DNS_CONTROL', data=params)
@@ -105,6 +114,7 @@ class DirectAdminClient:
('value', record_value_new)])
if record_ttl is not None:
# Non-default is specified so we should add on the record
params.update({'ttl': record_ttl})
response = self.make_request('CMD_API_DNS_CONTROL', data=params)