class SupermasterManager (View source)

Creates, updates and deletes PowerDNS supermasters.

Methods

addSupermaster(string $master_ip, string $ns_name, string $account)

Add a trusted supermaster to the global supermasters table.

deleteSupermaster(string $master_ip, string $ns_name)

Delete a supermaster from the global supermasters table.

array
getSupermasters()

Get All Supermasters

array
getSupermasterInfoFromIp(string $master_ip)

Get Supermaster Info from IP

bool
supermasterExists(string $master_ip)

Check if Supermaster IP address exists

bool
supermasterIpNameExists(string $master_ip, string $ns_name)

Check if Supermaster IP Address and NS Name combo exists

updateSupermaster(string $old_master_ip, string $old_ns_name, string $new_master_ip, string $new_ns_name, string $account)

Update a trusted supermaster in the global supermasters table.

array
getSlaveServerIPs()

Get distinct slave server IP addresses

static bool
validateAccount(string $account)

Validate Account is valid string

Details

__construct(UserLookupInterface $users, ConfigurationInterface $config, SupermasterBackendInterface $backendProvider)

Constructor

Parameters

UserLookupInterface $users

Resolves the full name of the account a supermaster hands zones to

ConfigurationInterface $config

Configuration manager

SupermasterBackendInterface $backendProvider

DNS backend provider

SupermasterWriteResult addSupermaster(string $master_ip, string $ns_name, string $account)

Add a trusted supermaster to the global supermasters table.

Parameters

string $master_ip

Supermaster IP address

string $ns_name

Hostname of the supermaster found in NS records for the domain

string $account

Account name used for tracking

Return Value

SupermasterWriteResult

SupermasterWriteResult deleteSupermaster(string $master_ip, string $ns_name)

Delete a supermaster from the global supermasters table.

Parameters

string $master_ip

Supermaster IP address

string $ns_name

Hostname of the supermaster

Return Value

SupermasterWriteResult

array getSupermasters()

Get All Supermasters

Gets an array of arrays of supermaster details

Return Value

array

supermasters detail [master_ip,ns_name,account]s

array getSupermasterInfoFromIp(string $master_ip)

Get Supermaster Info from IP

Retrieve supermaster details from supermaster IP address

Parameters

string $master_ip

Supermaster IP address

Return Value

array

array of supermaster details

bool supermasterExists(string $master_ip)

Check if Supermaster IP address exists

Parameters

string $master_ip

Supermaster IP

Return Value

bool

true if exists, otherwise false

bool supermasterIpNameExists(string $master_ip, string $ns_name)

Check if Supermaster IP Address and NS Name combo exists

Parameters

string $master_ip

Supermaster IP Address

string $ns_name

Supermaster NS Name

Return Value

bool

true if exists, false otherwise

SupermasterWriteResult updateSupermaster(string $old_master_ip, string $old_ns_name, string $new_master_ip, string $new_ns_name, string $account)

Update a trusted supermaster in the global supermasters table.

Parameters

string $old_master_ip

Original supermaster IP address

string $old_ns_name

Original hostname of the supermaster

string $new_master_ip

New supermaster IP address

string $new_ns_name

New hostname of the supermaster

string $account

Account name used for tracking

Return Value

SupermasterWriteResult

array getSlaveServerIPs()

Get distinct slave server IP addresses

Return Value

array

List of unique slave server IP addresses

static bool validateAccount(string $account)

Validate Account is valid string

Parameters

string $account

Account name alphanumeric and ._-

Return Value

bool

true is valid, false otherwise