Python SDK
DNS
DNS zones and recordsets
10 methods
list_zones()
List zones
Parameters
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
statusstring
- Filter by status
typestring
- Filter by zone type
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.list_zones()print(result)
create_zone()
Create zone
Parameters
namestring
required- Zone name (must end with a dot)
descriptionstring
emailstring
requiredttlinteger
typestring
mastersarray
- Master nameservers (required for SECONDARY zones)
attributesobject
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.create_zone(name="example.com.", email="admin@example.com")print(result)
get_zone()
Get zone
Parameters
zone_idstring
required- DNS Zone ID
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.get_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")print(result)
update_zone()
Update zone
Parameters
zone_idstring
required- DNS Zone ID
descriptionstring
emailstring
ttlinteger
mastersarray
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.update_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")print(result)
delete_zone()
Delete zone
Parameters
zone_idstring
required- DNS Zone ID
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.delete_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")print(result)
list_recordsets()
List recordsets
Parameters
zone_idstring
required- DNS Zone ID
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
statusstring
- Filter by status
typestring
- Filter by record type
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.list_recordsets(zone_id="550e8400-e29b-41d4-a716-446655440000")print(result)
create_recordset()
Create recordset
Parameters
zone_idstring
required- DNS Zone ID
namestring
required- Record name (FQDN, must end with a dot)
descriptionstring
typestring
requiredttlinteger
recordsarray
requiredExample
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.create_recordset(zone_id="550e8400-e29b-41d4-a716-446655440000", name="www.example.com.", type="A", records=192.168.1.10)print(result)
get_recordset()
Get recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.get_recordset(zone_id="550e8400-e29b-41d4-a716-446655440000", recordset_id="550e8400-e29b-41d4-a716-446655440000")print(result)
update_recordset()
Update recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
descriptionstring
ttlinteger
recordsarray
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.update_recordset(zone_id="550e8400-e29b-41d4-a716-446655440000", recordset_id="550e8400-e29b-41d4-a716-446655440000")print(result)
delete_recordset()
Delete recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
Example
from bycloud import ByCloudclient = ByCloud(token="YOUR_ACCESS_TOKEN")result = client.dns.delete_recordset(zone_id="550e8400-e29b-41d4-a716-446655440000", recordset_id="550e8400-e29b-41d4-a716-446655440000")print(result)