Commit c174bc27 authored by Varac's avatar Varac

Merge branch '6-support-setting-ttl-for-domain-records' into 'master'

Resolve "support setting TTL for domain records"

Closes #6

See merge request !4
parents e972eaaf 59ad96a3
......@@ -59,7 +59,8 @@ def request_api(resource: str, request_type: str = 'GET',
# API calls
def create_domain_record(domain: str, name: str, data: str,
record_type: str = 'A', update: bool = False):
record_type: str = 'A', update: bool = False,
ttl: int = 3600):
"""Create domain record.
If 'update' is set to True, the record will be updated if it exists.
......@@ -69,7 +70,8 @@ def create_domain_record(domain: str, name: str, data: str,
record = {
'name': name,
'data': data,
'type': record_type
'type': record_type,
'ttl': ttl
# Check if record exists
existing_record = get_domain_record_by_name(domain=domain, name=name,
......@@ -5,7 +5,7 @@ with open("", "r") as fh:
description="Create and manipulate Greenhost VPSs via the command line or python functions.",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment