add ttl argument for create_domain_record function

parent e972eaaf
......@@ -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("README.md", "r") as fh:
setuptools.setup(
name="greenhost_cloud",
version="0.1.1",
version="0.1.2",
author="Greenhost",
author_email="info@greenhost.net",
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