ByCloud Docs
GuidesCLIAPISDK

PHP SDK

DNS

DNS zones and recordsets

10 methods

GET

listZones()

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

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->listZones();
print_r($result);
POST

createZone()

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

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->createZone([
'name' => 'example.com.',
'email' => 'admin@example.com'
]);
print_r($result);
GET

getZone()

Get zone

Parameters

zone_id

string

required

- DNS Zone ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->getZone([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
PATCH

updateZone()

Update zone

Parameters

zone_id

string

required

- DNS Zone ID

description

string

email

string

ttl

integer

masters

array

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->updateZone([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
DELETE

deleteZone()

Delete zone

Parameters

zone_id

string

required

- DNS Zone ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->deleteZone([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
GET

listRecordsets()

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

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->listRecordsets([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
POST

createRecordset()

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

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->createRecordset([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000',
'name' => 'www.example.com.',
'type' => 'A',
'records' => [
'192.168.1.10'
]
]);
print_r($result);
GET

getRecordset()

Get recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->getRecordset([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000',
'recordset_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
PATCH

updateRecordset()

Update recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

description

string

ttl

integer

records

array

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->updateRecordset([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000',
'recordset_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
DELETE

deleteRecordset()

Delete recordset

Parameters

zone_id

string

required

- DNS Zone ID

recordset_id

string

required

- DNS Recordset ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->dns->deleteRecordset([
'zone_id' => '550e8400-e29b-41d4-a716-446655440000',
'recordset_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);