ByCloud Docs
GuidesCLIAPISDK

Python SDK

DNS

DNS zones and recordsets

10 methods

GET

list_zones()

List zones

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by status

type

string

- Filter by zone type

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.list_zones()
print(result)
POST

create_zone()

Create zone

Parameters

name

string

required

- Zone name (must end with a dot)

description

string

email

string

required
ttl

integer

type

string

masters

array

- Master nameservers (required for SECONDARY zones)

attributes

object

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.create_zone(name="example.com.", email="admin@example.com")
print(result)
GET

get_zone()

Get zone

Parameters

zone_id

string

required

- DNS Zone ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.get_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
PATCH

update_zone()

Update zone

Parameters

zone_id

string

required

- DNS Zone ID

description

string

email

string

ttl

integer

masters

array

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.update_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
DELETE

delete_zone()

Delete zone

Parameters

zone_id

string

required

- DNS Zone ID

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.delete_zone(zone_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
GET

list_recordsets()

List recordsets

Parameters

zone_id

string

required

- DNS Zone ID

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by status

type

string

- Filter by record type

Example

from bycloud import ByCloud
client = ByCloud(token="YOUR_ACCESS_TOKEN")
result = client.dns.list_recordsets(zone_id="550e8400-e29b-41d4-a716-446655440000")
print(result)
POST

create_recordset()

Create recordset

Parameters

zone_id

string

required

- DNS Zone ID

name

string

required

- Record name (FQDN, must end with a dot)

description

string

type

string

required
ttl

integer

records

array

required

Example

from bycloud import ByCloud
client = 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

get_recordset()

Get recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

Example

from bycloud import ByCloud
client = 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)
PATCH

update_recordset()

Update recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

description

string

ttl

integer

records

array

Example

from bycloud import ByCloud
client = 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

delete_recordset()

Delete recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

Example

from bycloud import ByCloud
client = 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)